diff options
author | Kyriakos Markakis <kyriakos@marqui.dev> | 2019-11-12 18:52:43 +0300 |
---|---|---|
committer | Gireesh Punathil <gpunathi@in.ibm.com> | 2019-11-25 09:17:44 +0300 |
commit | 12a21aee1896dffcaf9b598c50908ee554d3abec (patch) | |
tree | 27969f8b959ac0f31f727c43c633ecf3dd7ed3e5 /lib/internal/stream_base_commons.js | |
parent | dfbdfb4d324aaceee1c21b8817c90ee533e61be4 (diff) |
lib: change var to let in stream_base_commons
PR-URL: https://github.com/nodejs/node/pull/30426
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'lib/internal/stream_base_commons.js')
-rw-r--r-- | lib/internal/stream_base_commons.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/internal/stream_base_commons.js b/lib/internal/stream_base_commons.js index eb2e53963d8..95430ff738f 100644 --- a/lib/internal/stream_base_commons.js +++ b/lib/internal/stream_base_commons.js @@ -111,16 +111,15 @@ function createWriteWrap(handle) { function writevGeneric(self, data, cb) { const req = createWriteWrap(self[kHandle]); const allBuffers = data.allBuffers; - var chunks; - var i; + let chunks; if (allBuffers) { chunks = data; - for (i = 0; i < data.length; i++) + for (let i = 0; i < data.length; i++) data[i] = data[i].chunk; } else { chunks = new Array(data.length << 1); - for (i = 0; i < data.length; i++) { - var entry = data[i]; + for (let i = 0; i < data.length; i++) { + const entry = data[i]; chunks[i * 2] = entry.chunk; chunks[i * 2 + 1] = entry.encoding; } |