* Find the logical index of `item` (reference equality). O(n). * Returns -1 if not found. * @returns {number}
(item)
| 98 | * @returns {number} |
| 99 | */ |
| 100 | indexOf(item) { |
| 101 | for (let i = 0; i < this.#size; i++) { |
| 102 | if (this.#backing[(this.#head + i) & this.#mask] === item) { |
| 103 | return i; |
| 104 | } |
| 105 | } |
| 106 | return -1; |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * Remove the item at logical `index`, shifting later elements. O(n) worst case. |
no outgoing calls
no test coverage detected