
Issue #20049 has been updated by chucke (Tiago Cardoso). for comparison, the original implementation can be found here: https://github.com/igrigorik/http-2/blob/master/lib/http/2/connection.rb#L70... (http-2-next is a fork of http-2 gem). FWIW zverok's use case is also reasonably common. ---------------------------------------- Feature #20049: Destructive drop_while for Array and Hash https://bugs.ruby-lang.org/issues/20049#change-105774 * Author: chucke (Tiago Cardoso) * Status: Feedback * Priority: Normal ---------------------------------------- I propose a "drop_while!" variant for arrays and hashes, which changes the current instance. ```ruby h = {foo: 0, bar: 1, baz: 2} h.drop_while!{|element| key, value = *element; value < 2 } h #=> # => { baz: 2 } ``` -- https://bugs.ruby-lang.org/