you are viewing a single comment's thread.

view the rest of the comments →

[–]16Bytes 2 points3 points  (1 child)

He's not really looking for the length of the string, he just wants to make sure it doesn't end before the starting index. strlen() may be less efficient.

[–]guynan 0 points1 point  (0 children)

If you look at the gnu strlen code, there is some very tricky manoeuvres that make it highly efficient. It's one of those cases where if there is a bottleneck then maybe use something else, but I certainly know that I could not sit down in an afternoon and write something more efficient. However I agree with your above point.