I'll admit I found it very amusing to read
> Only one byte is loaded for each character of string.
right after he calls strlen on the input on the first line of his function :P
> Only one byte is loaded for each character of string.
right after he calls strlen on the input on the first line of his function :P
String APIs are critical to the discussion of algorithm costs, e.g. removing the final character from a string is O(n) if they are null terminated, or O(1) if the string stores its size. Assuming the best of both worlds by ignoring strlen costs is hand-waving away a lot of the real world performance.
If you wanna be annoying about this, just imagine he's implementing `strnstr` instead of `strstr`.