()
| 109 | } |
| 110 | |
| 111 | shift() { |
| 112 | const tail = this.tail; |
| 113 | const next = tail.shift(); |
| 114 | if (tail.isEmpty() && tail.next !== null) { |
| 115 | // If there is another queue, it forms the new tail. |
| 116 | this.tail = tail.next; |
| 117 | tail.next = null; |
| 118 | tail.bottom = 0; |
| 119 | tail.top = 0; |
| 120 | |
| 121 | if (FixedQueue.#pool.length < 64) { |
| 122 | FixedQueue.#pool.push(tail); // Recycle old tail |
| 123 | } |
| 124 | } |
| 125 | return next; |
| 126 | } |
| 127 | }; |
no test coverage detected