Skip to content

Commit efe42e0

Browse files
authored
fix: issue where clear() is still keeping references to the elements (#47)
1 parent 4b11d11 commit efe42e0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ Denque.prototype.splice = function splice(index, count) {
358358
* Soft clear - does not reset capacity.
359359
*/
360360
Denque.prototype.clear = function clear() {
361+
this._list = new Array(this._list.length);
361362
this._head = 0;
362363
this._tail = 0;
363364
};

0 commit comments

Comments
 (0)