GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — timers: simplify the compareTimersLists function · nodejs/node@0ad450f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal
    • timers.js
Expand file treeCollapse file tree
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)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.