* Remove all items. O(n) for GC cleanup.
()
| 126 | * Remove all items. O(n) for GC cleanup. |
| 127 | */ |
| 128 | clear() { |
| 129 | for (let i = 0; i < this.#size; i++) { |
| 130 | this.#backing[(this.#head + i) & this.#mask] = undefined; |
| 131 | } |
| 132 | this.#head = 0; |
| 133 | this.#size = 0; |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Double the backing capacity, linearizing the circular layout. |