MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / extractMin

Method extractMin

common/src/util/min-heap.ts:70–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 }
69
70 extractMin(): T | undefined {
71 if (this.heap.length === 0) return undefined
72
73 const minItem = this.heap[0].item
74 const last = this.heap.pop()!
75
76 if (this.heap.length > 0) {
77 this.heap[0] = last
78 this.siftDown(0)
79 }
80
81 return minItem
82 }
83
84 get size(): number {
85 return this.heap.length

Callers

nothing calls this directly

Calls 1

siftDownMethod · 0.95

Tested by

no test coverage detected