lib/httpx/timers.rb in httpx-1.2.6 vs lib/httpx/timers.rb in httpx-1.3.0
- old
+ new
@@ -41,10 +41,10 @@
raise error if error && error.timeout != @intervals.first
return if @intervals.empty? || !@next_interval_at
elapsed_time = Utils.elapsed_time(@next_interval_at)
- @intervals.delete_if { |interval| interval.elapse(elapsed_time) <= 0 }
+ @intervals = @intervals.drop_while { |interval| interval.elapse(elapsed_time) <= 0 }
@next_interval_at = nil if @intervals.empty?
end
class Interval