Skip to content

Commit 24a2065

Browse files
committed
move var
1 parent 5c353f0 commit 24a2065

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/internal/priority_queue.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ module.exports = class PriorityQueue {
105105
heap[size + 1] = undefined;
106106

107107
if (size > 0 && pos <= size) {
108-
const parent = pos >> 1;
109-
if (pos > 1 && this.#compare(heap[parent], heap[pos]) > 0)
108+
if (pos > 1 && this.#compare(heap[pos >> 1], heap[pos]) > 0)
110109
this.percolateUp(pos);
111110
else
112111
this.percolateDown(pos);

0 commit comments

Comments
 (0)