tweaks: remove a superfluous strlen() call from the reverse searches
If the length of the haystack is smaller than the length of the needle, this means that also the length of the tail will be smaller -- because pointer will be bigger than or equal to haystack -- so the pointer gets readjusted to be a needle length before the end of the haystack, which means that it ends up /before/ the haystack: thus the while loop will never run. On average, this saves some 200 nanoseconds per line.
Showing
+0 -9
Please register or sign in to comment