MCPcopy Create free account
hub / github.com/ampproject/amphtml / peek

Method peek

src/core/data-structures/priority-queue.js:21–27  ·  view source on GitHub ↗

* Returns the max priority item without dequeueing it. * @return {?T}

()

Source from the content-addressed store, hash-verified

19 * @return {?T}
20 */
21 peek() {
22 const l = this.length;
23 if (!l) {
24 return null;
25 }
26 return this.queue_[l - 1].item;
27 }
28
29 /**
30 * Enqueues an item with the given priority.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected