MCPcopy
hub / github.com/CodebuffAI/codebuff / swap

Method swap

common/src/util/min-heap.ts:19–23  ·  view source on GitHub ↗
(index1: number, index2: number)

Source from the content-addressed store, hash-verified

17 }
18
19 private swap(index1: number, index2: number): void {
20 const temp = this.heap[index1]
21 this.heap[index1] = this.heap[index2]
22 this.heap[index2] = temp
23 }
24
25 private siftUp(index: number): void {
26 while (index > 0) {

Callers 2

siftUpMethod · 0.95
siftDownMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected