MCPcopy Create free account
hub / github.com/sindresorhus/p-queue / #compact

Method #compact

source/priority-queue.ts:119–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117 }
118
119 #compact(): void {
120 // Compaction restores the invariant that the whole array is the live sorted range.
121 if (this.#head === 0) {
122 return;
123 }
124
125 this.#queue.splice(0, this.#head);
126 this.#head = 0;
127 }
128}

Callers 2

enqueueMethod · 0.95
dequeueMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected