From 6494bfc134eeba91ae21b500f1e7018c2e8c01db 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 PR-URL: https://github.com/nodejs/node/pull/36560 Reviewed-By: Antoine du Hamel Reviewed-By: Pooja D P Reviewed-By: Rich Trott --- 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;