Skip to content

Commit 1a7f63d

Browse files
gurgundayaduh95
authored andcommitted
timers: simplify the compareTimersLists function
PR-URL: #57110 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Jason Zhang <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
1 parent 7cf5d20 commit 1a7f63d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/internal/timers.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,7 @@ function getTimerDuration(msecs, name) {
422422
function compareTimersLists(a, b) {
423423
const expiryDiff = a.expiry - b.expiry;
424424
if (expiryDiff === 0) {
425-
if (a.id < b.id)
426-
return -1;
427-
if (a.id > b.id)
428-
return 1;
425+
return a.id - b.id;
429426
}
430427
return expiryDiff;
431428
}

0 commit comments

Comments
 (0)