Skip to content

Commit a0f8afd

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

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/internal/test_runner/mock/fake_timers.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@ const {
99
const PriorityQueue = require('internal/priority_queue');
1010

1111
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;
12+
return (a.runAt - b.runAt) || (a.id - b.id);
2013
}
2114

2215
function setPosition(node, pos) {

0 commit comments

Comments
 (0)