@param {T} data
(data)
| 867 | } |
| 868 | /** @param {T} data */ |
| 869 | push(data) { |
| 870 | if (this.head.isFull()) { |
| 871 | this.head = this.head.next = new FixedCircularBuffer(); |
| 872 | } |
| 873 | this.head.push(data); |
| 874 | } |
| 875 | /** @returns {T|null} */ |
| 876 | shift() { |
| 877 | const tail = this.tail; |