MCPcopy Index your code
hub / github.com/ampproject/amphtml / toArray

Function toArray

test/unit/core/data-structures/test-priority-queue.js:14–20  ·  view source on GitHub ↗

* @param {PriorityQueue } pq * @return {Array }

(pq)

Source from the content-addressed store, hash-verified

12 * @return {Array<T>}
13 */
14 function toArray(pq) {
15 const array = [];
16 while (pq.length) {
17 array.push(pq.dequeue());
18 }
19 return array;
20 }
21
22 it('should return the correct length of the queue', () => {
23 expect(pq.length).to.equal(0);

Callers 1

Calls 2

pushMethod · 0.45
dequeueMethod · 0.45

Tested by

no test coverage detected