@param {T} data
(data)
| 113 | |
| 114 | /** @param {T} data */ |
| 115 | push (data) { |
| 116 | if (this.head.isFull()) { |
| 117 | // Head is full: Creates a new queue, sets the old queue's `.next` to it, |
| 118 | // and sets it as the new main queue. |
| 119 | this.head = this.head.next = new FixedCircularBuffer() |
| 120 | } |
| 121 | this.head.push(data) |
| 122 | } |
| 123 | |
| 124 | /** @returns {T|null} */ |
| 125 | shift () { |
no test coverage detected