All posts filed under: ruby

Stupid coding mistakes

Leave a comment
programming / ruby

Made this mistake today while writing some code to delete data out of Redis. [crayon-5f3748e568c55110491630/] The mistake was in the final method keep_keys. Every check to see if a key should be rejected I was adding an element to the flattened_keys array over and over again, causing my deletion to slow down over time. A simple change to memoize the keep keys made the process go from never finishing to, completing in a few seconds. […]