mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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:
1 parent
cf1d3d1565
commit
2b4e46f07d
1 file changed
+2
-2
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user