4 ms·
> But checking lengths doesn't really help you: it only tells you when strings are not equal, and you would still have to walk the string to see which one is la
by orlp 4y ago
> But checking lengths doesn't really help you: it only tells you when strings are not equal, and you would still have to walk the string to see which one is larger/smaller.
Only for a three-way comparison. If all you care about is equality different lengths gives a fast path for inequality.