Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
timers: simplify the compareTimersLists function
  • Loading branch information
gurgunday committed Feb 23, 2025
commit 9239cbad2980b242567966fce32e8c03bb57d49f
5 changes: 1 addition & 4 deletions lib/internal/timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,7 @@ function getTimerDuration(msecs, name) {
function compareTimersLists(a, b) {
const expiryDiff = a.expiry - b.expiry;
if (expiryDiff === 0) {
if (a.id < b.id)
return -1;
if (a.id > b.id)
return 1;
return a.id - b.id;
}
return expiryDiff;
}
Expand Down