> 2025-11-18 Bruno Haible <[email protected]> > > lib: Replace some 'continue;' statements with if/else.
Some more of the same kind: 2025-12-04 Bruno Haible <[email protected]> memmem, strstr: Replace some 'continue;' statements with if/else. * lib/str-two-way.h (two_way_long_needle): Use if/else instead of 'continue;'. git diff -w: diff --git a/lib/str-two-way.h b/lib/str-two-way.h index 852e5d078f..1da773eb70 100644 --- a/lib/str-two-way.h +++ b/lib/str-two-way.h @@ -374,8 +374,9 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len, } memory = 0; j += shift; - continue; } + else + { /* Scan for matches in right half. The last byte has already been matched, by virtue of the shift table. */ size_t i = MAX (suffix, memory); @@ -403,6 +404,7 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len, } } } + } else { /* The two halves of needle are distinct; no extra memory is @@ -418,8 +420,9 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len, if (0 < shift) { j += shift; - continue; } + else + { /* Scan for matches in right half. The last byte has already been matched, by virtue of the shift table. */ size_t i = suffix; @@ -441,6 +444,7 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len, j += i - suffix + 1; } } + } return NULL; }
