Hacker News new | ask | show | jobs
by Sharlin 2955 days ago
Depends on your input. If non-ASCII strings are frequent and likely to contain a non-ASCII character fairly close to the start of the string, then it makes sense to short circuit.
1 comments

The previous >0 algorithm didn't short-circuit. There is no change to short-circuit behavior here.
Ah, I was thinking of the naive implementation in the previous post [1].

[1] https://lemire.me/blog/2018/05/09/how-quickly-can-you-check-...