Skip to content

Commit c3c0d7d

Browse files
authored
optimize
1 parent e870b8c commit c3c0d7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/priority_queue.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ module.exports = class PriorityQueue {
116116
}
117117

118118
shift() {
119-
if (this.#size === 0)
120-
return;
121119
const heap = this.#heap;
122120
const value = heap[1];
121+
if (value === undefined)
122+
return;
123123

124124
this.removeAt(1);
125125

0 commit comments

Comments
 (0)