Skip to content

Commit e870b8c

Browse files
committed
fill heap[0] and heap[1] to prevent proto chain lookup
1 parent 7cf99a5 commit e870b8c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/internal/priority_queue.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = class PriorityQueue {
2121
this.#compare = comparator;
2222
if (setPosition !== undefined)
2323
this.#setPosition = setPosition;
24+
this.#heap[0] = this.#heap[1] = undefined;
2425
}
2526

2627
insert(value) {

0 commit comments

Comments
 (0)