class IO::Event::PriorityHeap
def valid?
Validate the heap invariant. Every element except the root must not be smaller than
def valid? # notice we skip index 0 on purpose, because it has no parent (1..(@contents.size - 1)).all? { |e| @contents[e] >= @contents[(e - 1) / 2] } end