Skip to content

Commit e6c0877

Browse files
Lxxyxtargos
authored andcommitted
lib: refactor to use primordials in internal/priority_queue.js
PR-URL: #36560 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Pooja D P <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent c8b2218 commit e6c0877

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/priority_queue.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
Array,
5+
ArrayPrototypeIndexOf,
56
Symbol,
67
} = primordials;
78

@@ -106,7 +107,7 @@ module.exports = class PriorityQueue {
106107

107108
remove(value) {
108109
const heap = this[kHeap];
109-
const pos = heap.indexOf(value);
110+
const pos = ArrayPrototypeIndexOf(heap, value);
110111
if (pos < 1)
111112
return false;
112113

0 commit comments

Comments
 (0)