From dc786c331569da6fac6dfe6766e4cf87438759ad Mon Sep 17 00:00:00 2001 From: Kyriakos Markakis Date: Tue, 12 Nov 2019 15:52:43 +0000 Subject: [PATCH] lib: change var to let in stream_base_commons PR-URL: https://github.com/nodejs/node/pull/30426 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat --- lib/internal/stream_base_commons.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/internal/stream_base_commons.js b/lib/internal/stream_base_commons.js index eb2e53963d82b3..95430ff738fdb5 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; }