Skip to content

Commit 6fe8ec2

Browse files
committed
Clear buffer entry on shift/popleft
1 parent 713ca14 commit 6fe8ec2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/queue.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export class Queue<T> {
4646
}
4747

4848
const value = this.#buffer[this.#head]!
49+
this.#buffer[this.#head] = undefined
4950

5051
this.#head = (this.#head + 1) % this.#buffer.length
5152
this.#size--

0 commit comments

Comments
 (0)