mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
stream: check for null instead of falsy in loops
Check for null in while loops. This is preparing 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:
@@ -57,7 +57,7 @@ module.exports = class BufferList {
|
||||
return '';
|
||||
let p = this.head;
|
||||
let ret = '' + p.data;
|
||||
while (p = p.next)
|
||||
while ((p = p.next) !== null)
|
||||
ret += s + p.data;
|
||||
return ret;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ module.exports = class BufferList {
|
||||
break;
|
||||
}
|
||||
++c;
|
||||
} while (p = p.next);
|
||||
} while ((p = p.next) !== null);
|
||||
this.length -= c;
|
||||
return ret;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ module.exports = class BufferList {
|
||||
break;
|
||||
}
|
||||
++c;
|
||||
} while (p = p.next);
|
||||
} while ((p = p.next) !== null);
|
||||
this.length -= c;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user