Skip to content

Commit 0ad450f

Browse files
gurgundaytargos
authored andcommittedMar 11, 2025
timers: simplify the compareTimersLists function
PR-URL: #57110 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Jason Zhang <xzha4350@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
1 parent 5204d49 commit 0ad450f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed
 

‎lib/internal/timers.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,7 @@ function getTimerDuration(msecs, name) {
442442
function compareTimersLists(a, b) {
443443
const expiryDiff = a.expiry - b.expiry;
444444
if (expiryDiff === 0) {
445-
if (a.id < b.id)
446-
return -1;
447-
if (a.id > b.id)
448-
return 1;
445+
return a.id - b.id;
449446
}
450447
return expiryDiff;
451448
}

0 commit comments

Comments
 (0)
Please sign in to comment.