MCPcopy Index your code
hub / github.com/RustPython/RustPython / heappushpop

Function heappushpop

Lib/heapq.py:164–169  ·  view source on GitHub ↗

Fast version of a heappush followed by a heappop.

(heap, item)

Source from the content-addressed store, hash-verified

162 return returnitem
163
164def heappushpop(heap, item):
165 """Fast version of a heappush followed by a heappop."""
166 if heap and heap[0] < item:
167 item, heap[0] = heap[0], item
168 _siftup(heap, 0)
169 return item
170
171def heapify(x):
172 """Transform list into a heap, in-place, in O(len(x)) time."""

Callers

nothing calls this directly

Calls 1

_siftupFunction · 0.85

Tested by

no test coverage detected