--HG--
branch : aspn
This commit is contained in:
baloan
2011-03-02 22:36:34 +01:00
parent 2a20e09944
commit 648a39a1f3

View File

@@ -14,7 +14,7 @@ class Heap(list):
heapify = heapq.heapify heapify = heapq.heapify
def pushpop(self, item): def pushpop(self, item):
"Push the item onto the heap and then pop the smallest value" """Push the item onto the heap and then pop the smallest value"""
if self and self[0] < item: if self and self[0] < item:
return heapq.heapreplace(self, item) return heapq.heapreplace(self, item)
return item return item