From 83eb35d4c6ebf9d96fc5b160030b8fcc5ac15c42 Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Fri, 18 Dec 2020 18:21:58 +0800 Subject: [PATCH] lib: refactor to use primordials in internal/priority_queue.js --- lib/internal/priority_queue.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/priority_queue.js b/lib/internal/priority_queue.js index c31c1eea385857..a0a18f7301e3b7 100644 --- a/lib/internal/priority_queue.js +++ b/lib/internal/priority_queue.js @@ -2,6 +2,7 @@ const { Array, + ArrayPrototypeIndexOf, Symbol, } = primordials; @@ -106,7 +107,7 @@ module.exports = class PriorityQueue { remove(value) { const heap = this[kHeap]; - const pos = heap.indexOf(value); + const pos = ArrayPrototypeIndexOf(heap, value); if (pos < 1) return false;