The reject! method in Ruby selectively removes elements from an array in-place, based on a provided predicate (in the form of a block). Between Ruby 1.9.3 and Ruby 2.3, reject! was accidentally quadratic. The underlying bug was fairly straightforward. Every time the provided predicate returned true, the code immediately deleted that element: if (RTEST(rb_yield(v))) { rb_ary_delete_at(ary, i); resu