Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0ad450f

Browse filesBrowse 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
Copy full SHA for 0ad450f

File tree

Expand file treeCollapse file tree

1 file changed

+1
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-4
lines changed
Open diff view settings
Collapse file

‎lib/internal/timers.js‎

Copy file name to clipboardExpand all lines: lib/internal/timers.js
+1-4Lines 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

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.