MCPcopy
hub / github.com/vercel/next.js / heapDelete

Function heapDelete

packages/next/src/client/components/segment-cache/scheduler.ts:1807–1820  ·  view source on GitHub ↗
(heap: Array<PrefetchTask>, node: PrefetchTask)

Source from the content-addressed store, hash-verified

1805}
1806
1807function heapDelete(heap: Array<PrefetchTask>, node: PrefetchTask): void {
1808 const index = node._heapIndex
1809 if (index !== -1) {
1810 node._heapIndex = -1
1811 if (heap.length !== 0) {
1812 const last = heap.pop() as PrefetchTask
1813 if (last !== node) {
1814 heap[index] = last
1815 last._heapIndex = index
1816 heapSiftDown(heap, last, index)
1817 }
1818 }
1819 }
1820}
1821
1822function heapResift(heap: Array<PrefetchTask>, node: PrefetchTask): void {
1823 const index = node._heapIndex

Callers 1

cancelPrefetchTaskFunction · 0.85

Calls 2

heapSiftDownFunction · 0.85
popMethod · 0.45

Tested by

no test coverage detected