Extract value, close the gap, update length, and optionally shrink.
(index: number)
| 808 | |
| 809 | /** Extract value, close the gap, update length, and optionally shrink. */ |
| 810 | #removeAtUnchecked(index: number): T { |
| 811 | const val = this.#buffer[(this.#head + index) & this.#mask] as T; |
| 812 | if (index < this.#length - index - 1) { |
| 813 | this.#closeGapFromFront(index); |
| 814 | } else { |
| 815 | this.#closeGapFromBack(index); |
| 816 | } |
| 817 | this.#length--; |
| 818 | this.#maybeShrink(); |
| 819 | return val; |
| 820 | } |
| 821 | |
| 822 | /** Close the gap at `i` by shifting elements before it one slot toward the back. */ |
| 823 | #closeGapFromFront(i: number): void { |
no test coverage detected