4 ms·
The accepted answer fails to note that the subject code is a high-performance variant of strlen(), and has basically taken the ideas from many highly-optimized
by gonzo 7y ago
The accepted answer fails to note that the subject code is a high-performance variant of strlen(), and has basically taken the ideas from many highly-optimized memcpy() routines.
There is nothing wrong with the simpler version, but it’s not as fast (for longer strings).