mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
stream: use standard for loop instead of for..of
Use the standard `for` loop style instead of `for..of` for consistency. PR-URL: https://github.com/nodejs/node/pull/41871 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
This commit is contained in:
1 parent
d91a956419
commit
07463b3374
1 file changed
+3
-1
@@ -42,8 +42,10 @@ ObjectSetPrototypeOf(Duplex.prototype, Readable.prototype);
|
||||
ObjectSetPrototypeOf(Duplex, Readable);
|
||||
|
||||
{
|
||||
const keys = ObjectKeys(Writable.prototype);
|
||||
// Allow the keys array to be GC'ed.
|
||||
for (const method of ObjectKeys(Writable.prototype)) {
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const method = keys[i];
|
||||
if (!Duplex.prototype[method])
|
||||
Duplex.prototype[method] = Writable.prototype[method];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user