Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eb6b386

Browse filesBrowse files
mscdexdanielleadams
authored andcommitted
lib: remove unused code
PR-URL: #36632 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent 7fe1b5e commit eb6b386
Copy full SHA for eb6b386

File tree

Expand file treeCollapse file tree

2 files changed

+0
-33
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+0
-33
lines changed
Open diff view settings
Collapse file

‎lib/internal/priority_queue.js‎

Copy file name to clipboardExpand all lines: lib/internal/priority_queue.js
-12Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const {
44
Array,
5-
ArrayPrototypeIndexOf,
65
Symbol,
76
} = primordials;
87

@@ -105,17 +104,6 @@ module.exports = class PriorityQueue {
105104
}
106105
}
107106

108-
remove(value) {
109-
const heap = this[kHeap];
110-
const pos = ArrayPrototypeIndexOf(heap, value);
111-
if (pos < 1)
112-
return false;
113-
114-
this.removeAt(pos);
115-
116-
return true;
117-
}
118-
119107
shift() {
120108
const heap = this[kHeap];
121109
const value = heap[1];
Collapse file

‎test/parallel/test-priority-queue.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-priority-queue.js
-21Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,6 @@ const PriorityQueue = require('internal/priority_queue');
4343
assert.strictEqual(queue.shift(), undefined);
4444
}
4545

46-
{
47-
// Checks that remove works as expected.
48-
const queue = new PriorityQueue();
49-
for (let i = 16; i > 0; i--)
50-
queue.insert(i);
51-
52-
const removed = [5, 10, 15];
53-
for (const id of removed)
54-
assert(queue.remove(id));
55-
56-
assert(!queue.remove(100));
57-
assert(!queue.remove(-100));
58-
59-
for (let i = 1; i < 17; i++) {
60-
if (removed.indexOf(i) < 0)
61-
assert.strictEqual(queue.shift(), i);
62-
}
63-
64-
assert.strictEqual(queue.shift(), undefined);
65-
}
66-
6746
{
6847
// Make a max heap with a custom sort function.
6948
const queue = new PriorityQueue((a, b) => b - a);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.