From 7aa35058f7c6cd26c8e372a63448cf68b5fc9ee0 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 13 Apr 2004 00:12:23 +0000 Subject: [PATCH] Commented a possible optimization. --- src/schedule.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/schedule.py b/src/schedule.py index 001df6933..8c498628b 100644 --- a/src/schedule.py +++ b/src/schedule.py @@ -93,6 +93,11 @@ 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] + # We must heapify here because the heap property may not be preserved + # by the above list comprehension. We could, conceivably, just mark + # the elements of the heap as removed and ignore them when we heappop, + # but that would only save a constant factor (we're already linear for + # the listcomp) so I'm not worried about it right now. heapq.heapify(self.schedule) def addPeriodicEvent(self, f, t, name=None):