mirror of
https://git.musl-libc.org/git/musl
synced 2025-02-15 17:54:23 +03:00
fix misleading comment in strstr
the intent here is just to scan at least l bytes forward for the end of the haystack and at least some decent minimum to avoid doing it over and over if the needle is short, with no need to be precise. the comment erroneously stated this as an estimate for MIN when it's actually an estimate for MAX.
This commit is contained in:
parent
b67d56c7b3
commit
c53e9b2394
@ -96,7 +96,7 @@ static char *twoway_strstr(const unsigned char *h, const unsigned char *n)
|
||||
for (;;) {
|
||||
/* Update incremental end-of-haystack pointer */
|
||||
if (z-h < l) {
|
||||
/* Fast estimate for MIN(l,63) */
|
||||
/* Fast estimate for MAX(l,63) */
|
||||
size_t grow = l | 63;
|
||||
const unsigned char *z2 = memchr(z, 0, grow);
|
||||
if (z2) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user