Skip to content

Commit 407644b

Browse files
committed
test_runner: add @ljharb suggestion
Signed-off-by: Erick Wendel <[email protected]>
1 parent 71ffd10 commit 407644b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/internal/test_runner/mock/fake_timers.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ const {
66
globalThis,
77
} = primordials;
88

9+
const console = require('console')
910
const PriorityQueue = require('internal/priority_queue');
1011

1112
function compareTimersLists(a, b) {
12-
const expiryDiff = a.runAt - b.runAt;
13-
if (expiryDiff === 0) {
14-
if (a.id < b.id)
15-
return -1;
16-
if (a.id > b.id)
17-
return 1;
18-
}
19-
return expiryDiff;
13+
return (a.runAt - b.runAt) || (a.id - b.id);
2014
}
2115

2216
function setPosition(node, pos) {

0 commit comments

Comments
 (0)