Skip to content

Commit cb99dbf

Browse files
committed
sdk-core: clear items removed by pop and shift in OverwritingArray
1 parent d232212 commit cb99dbf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/sdk-core/src/dataStructures/OverwritingArray.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ export class OverwritingArray<T> {
5656
public pop(): T | undefined {
5757
this.head--;
5858
const element = this._array[this.head];
59+
this._array[this.head] = undefined as never;
5960
this.length--;
6061
return element;
6162
}
6263

6364
public shift(): T | undefined {
6465
const element = this._array[this.start];
66+
this._array[this.start] = undefined as never;
6567
this.length--;
6668
return element;
6769
}

0 commit comments

Comments
 (0)