◐ Shell
clean mode source ↗

timers: simplify the compareTimersLists function · nodejs/node@0ad450f

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 0ad450f

gurgundaytargos

authored and

committed

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 file changed

Lines changed: 1 addition & 4 deletions

File tree

Lines changed: 1 addition & 4 deletions

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