# File lib/facet/heap.rb, line 186
  def heapify(i)
    l = left i
    top = if l < @heap_size && cmp_idx(l,i) then l else i end
    r = right i
    top = if r < @heap_size && cmp_idx(r,top) then r else top end
    if top != i
      swap(i, top)
      heapify(top)
    end
  end