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:
Mohammed Keyvanzadeh authored and Bryan English committed 2022-02-22 11:38:51 -05:00
1 parent d91a956419
commit 07463b3374
1 file changed
+3 -1
+3 -1
View File
@@ -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];
}