MCPcopy Create free account
hub / github.com/p2r3/convert / poll

Method poll

src/PriorityQueue.ts:144–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

142 }
143
144 public poll(): T | null {
145 if (this._size === 0) {
146 return null;
147 }
148 const s = --this._size;
149 const result = <T>this._queue[0];
150 const x = <T>this._queue[s];
151 this._queue.slice(s, 1);
152 if (s !== 0) {
153 this.sink(0, x);
154 }
155 return result;
156 }
157
158 public peek(): T | null {
159 return this._size === 0 ? null : <T>this._queue[0];

Callers 1

searchPathMethod · 0.95

Calls 1

sinkMethod · 0.95

Tested by

no test coverage detected