Add a heapify because our modifications don't guarantee that the heap property is preserved.

This commit is contained in:
Jeremy Fincher 2004-04-13 00:05:30 +00:00
parent bea41b308a
commit 07585182af

View File

@ -90,6 +90,7 @@ class Schedule(drivers.IrcDriver):
"""Removes the event with the given name from the schedule."""
del self.events[name]
self.schedule = [(t, n) for (t, n) in self.schedule if n != name]
heapq.heapify(self.schedule)
def addPeriodicEvent(self, f, t, name=None):
"""Adds a periodic event that is called every t seconds."""