Monkey patch



Articles tagged 'monkey-patch'

2009-11-05
A pitfall of the Ruby Range class

I tweeted about this, but figured it deserve a more lasting treatment.

If you've ever used Range#min or Range#max you may have inadvertently slowed your code significantly.

Both of those ought to be O(1) - constant time. After all, a Range in Ruby consist of two values, and though you can't ...