Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's a great point! Maybe you should log an issue or make a PR and fix it for everyone (except those who copied and pasted). This is exactly why it's a good thing for smaller modules that do one thing well, because when a tiny bug pops up everyone can automatically apply the patch.

I did do some tests a around this, but it showed nothing substantial. The comparison solution is much faster overall, the only point it falls down is with all lowercase strings where an early return would obviously be faster. Even a regexp was faster in some cases. It's highly subjective.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: