<p></p>
<blockquote>
<p dir="auto">The problem with <code>strlen("Entering directory '")</code> is <code>strlen</code> runs in linear time... basically equivalent to just rescanning (that portion of) the string. (Don't know whether compilers can optimize it to a constant.)</p>
</blockquote>
<p dir="auto">It looks like <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/elextr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/elextr">@elextr</a> nixed the idea of moving the pointer ahead for this case, but for future reference, I think you could use <code>sizeof "Entering directory"</code> instead of strlen. Because it's a constant, sizeof can be used, then the number will be known at compile-time and won't need to be computed at run-time. (Sometimes it will be important to be mindful that using the <code>sizeof</code> operator will give the result of the string length + 1 for the NULL terminator.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/2962#issuecomment-978907669">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJY3Q2SDSTKMOECNFFTUNXQ6FANCNFSM5G2EQTXA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJZOB5V3FWCZS3ZXWU3UNXQ6FA5CNFSM5G2EQTXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHJMPEFI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/2962#issuecomment-978907669",
"url": "https://github.com/geany/geany/pull/2962#issuecomment-978907669",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>