class IO::Event::PriorityHeap

def valid?

Validate the heap invariant. Every element except the root must not be smaller than its parent element. Note that it MAY be equal.
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