lib/new_relic/agent/heap.rb in newrelic_rpm-8.2.0 vs lib/new_relic/agent/heap.rb in newrelic_rpm-8.3.0

- old
+ new

@@ -16,20 +16,19 @@ # the root node is at index 0 # a node is a leaf node when its index >= length / 2 # class Heap - # @param [Array] items an optional array of items to intialize the heap # # @param [Callable] priority_fn an optional priority function used to # to compute the priority for an item. If it's not supplied priority # will be computed using Comparable. def initialize(items = nil, &priority_fn) @items = [] @priority_fn = priority_fn || ->(x) { x } - items.each{ |item| push(item) } if items + items.each { |item| push(item) } if items end def [](index) @items[index] end @@ -133,8 +132,7 @@ def swap(i, j) @items[i], @items[j] = @items[j], @items[i] end end - end end