Skip to content

Commit

Permalink
src: lib/internal/timers.js var -> let/const
Browse files Browse the repository at this point in the history
PR-URL: #30314
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
nikolaykrashnikov authored and BridgeAR committed Nov 19, 2019
1 parent 89bc252 commit d648c93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/internal/timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ function insert(item, refed, start) {
item._idleStart = start;

// Use an existing list if there is one, otherwise we need to make a new one.
var list = timerListMap[msecs];
let list = timerListMap[msecs];
if (list === undefined) {
debug('no %d list was found in insert, creating a new one', msecs);
const expiry = start + msecs;
Expand Down Expand Up @@ -396,7 +396,7 @@ function getTimerCallbacks(runNextTicks) {
function processImmediate() {
const queue = outstandingQueue.head !== null ?
outstandingQueue : immediateQueue;
var immediate = queue.head;
let immediate = queue.head;

// Clear the linked list early in case new `setImmediate()`
// calls occur while immediate callbacks are executed
Expand Down Expand Up @@ -482,10 +482,10 @@ function getTimerCallbacks(runNextTicks) {

debug('timeout callback %d', msecs);

var diff, timer;
let ranAtLeastOneTimer = false;
let timer;
while (timer = L.peek(list)) {
diff = now - timer._idleStart;
const diff = now - timer._idleStart;

// Check if this loop iteration is too early for the next timer.
// This happens if there are more timers scheduled for later in the list.
Expand Down

0 comments on commit d648c93

Please sign in to comment.