(heap: Array<PrefetchTask>)
| 1790 | } |
| 1791 | |
| 1792 | function heapPop(heap: Array<PrefetchTask>): PrefetchTask | null { |
| 1793 | if (heap.length === 0) { |
| 1794 | return null |
| 1795 | } |
| 1796 | const first = heap[0] |
| 1797 | first._heapIndex = -1 |
| 1798 | const last = heap.pop() as PrefetchTask |
| 1799 | if (last !== first) { |
| 1800 | heap[0] = last |
| 1801 | last._heapIndex = 0 |
| 1802 | heapSiftDown(heap, last, 0) |
| 1803 | } |
| 1804 | return first |
| 1805 | } |
| 1806 | |
| 1807 | function heapDelete(heap: Array<PrefetchTask>, node: PrefetchTask): void { |
| 1808 | const index = node._heapIndex |
no test coverage detected