Skip to content

Commit 7f69973

Browse files
VoltrexKeyvabengl
authored andcommitted
stream: use standard for loop instead of for..of
Use the standard `for` loop style instead of `for..of` for consistency. PR-URL: #41871 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Mestery <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
1 parent 7395de0 commit 7f69973

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/streams/duplex.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ ObjectSetPrototypeOf(Duplex.prototype, Readable.prototype);
4242
ObjectSetPrototypeOf(Duplex, Readable);
4343

4444
{
45+
const keys = ObjectKeys(Writable.prototype);
4546
// Allow the keys array to be GC'ed.
46-
for (const method of ObjectKeys(Writable.prototype)) {
47+
for (let i = 0; i < keys.length; i++) {
48+
const method = keys[i];
4749
if (!Duplex.prototype[method])
4850
Duplex.prototype[method] = Writable.prototype[method];
4951
}

0 commit comments

Comments
 (0)