Re:Ruby `reject!`
by inopinatus on Monday February 20, 2017 @10:52PM
(#13693149)
Looking forward to sister blog "Inadvertently Exponential" and the satirical "Maliciously Factorial".
[ Parent
| on HN ]
Many years ago, I got a bug report about a feature in an ex-coworker's code. The complaint was that the program would hang when you added the tenth item in a GUI. It turned out that it didn't really hang, but took a half hour to execute because the algorithm was inadvertently exponential. Further examination of the code revealed that the result of the exponential calculation wasn't even being used. So I didn't have to figure out how to make the algorithm linear - I just removed the useless code.