Skip to content

Commit

Permalink
stream: use standard for loop instead of for..of
Browse files Browse the repository at this point in the history
Use the standard `for` loop style instead of `for..of` for
consistency.

PR-URL: #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>
  • Loading branch information
VoltrexKeyva authored and targos committed Jul 31, 2022
1 parent 6641fda commit 545b2cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/streams/duplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit 545b2cd

Please sign in to comment.