minor
--HG-- branch : aspn
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user