• Benno Schulenberg's avatar
    tweaks: remove a superfluous strlen() call from the reverse searches · 1a79b3d5
    Benno Schulenberg authored
    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.
    1a79b3d5
chars.c 17.7 KB