Skip to content

Commit

Permalink
fix: issue where clear() is still keeping references to the elements (
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlmlr authored Jul 18, 2022
1 parent 4b11d11 commit efe42e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ Denque.prototype.splice = function splice(index, count) {
* Soft clear - does not reset capacity.
*/
Denque.prototype.clear = function clear() {
this._list = new Array(this._list.length);
this._head = 0;
this._tail = 0;
};
Expand Down

0 comments on commit efe42e0

Please sign in to comment.