Skip to content

Commit 0ad450f

Browse files
gurgundaytargos
authored andcommitted
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

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎lib/internal/timers.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,7 @@ function getTimerDuration(msecs, name) {
442442
functioncompareTimersLists(a,b){
443443
constexpiryDiff=a.expiry-b.expiry;
444444
if(expiryDiff===0){
445-
if(a.id<b.id)
446-
return-1;
447-
if(a.id>b.id)
448-
return1;
445+
returna.id-b.id;
449446
}
450447
returnexpiryDiff;
451448
}

0 commit comments

Comments
 (0)