timers: check for nullish instead of falsy in loops

This prepares the code for the no-cond-assign ESLint rule.

PR-URL: https://github.com/nodejs/node/pull/41614
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Rich Trott authored and Beth Griggs committed 2022-01-24 17:35:59 +00:00
1 parent cf1d3d1565
commit 2b4e46f07d
1 file changed
+2 -2
+2 -2
View File
@@ -490,7 +490,7 @@ function getTimerCallbacks(runNextTicks) {
let list;
let ranAtLeastOneList = false;
while (list = timerListQueue.peek()) {
while ((list = timerListQueue.peek()) != null) {
if (list.expiry > now) {
nextExpiry = list.expiry;
return refCount > 0 ? nextExpiry : -nextExpiry;
@@ -511,7 +511,7 @@ function getTimerCallbacks(runNextTicks) {
let ranAtLeastOneTimer = false;
let timer;
while (timer = L.peek(list)) {
while ((timer = L.peek(list)) != null) {
const diff = now - timer._idleStart;
// Check if this loop iteration is too early for the next timer.