←back to thread

3883 points kuroguro | 2 comments | | HN request time: 0s | source
Show context
luckystarr ◴[] No.26296728[source]
Well, that's embarrassing. I can't even imagine the level of shame I would feel if I had written the offending code.

But, you know, premature optimization yadda yadda.

replies(5): >>26296911 #>>26298188 #>>26301348 #>>26302026 #>>26308204 #
1. Cakez0r ◴[] No.26302026[source]
It's not a premature optimisation to use a hashset instead of a list though!
replies(1): >>26302165 #
2. ufo ◴[] No.26302165[source]
The bug is more devious than that. The code looks linear at a glance and the culprit is that sscanf is actually O(N) on the length of the string. How many people would expect that?