benchmark: use let instead of var

Use `let` in module, napi, net, os, path, process, querystring, streams
and string_decoder.

PR-URL: https://github.com/nodejs/node/pull/31592
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Daniele Belardi authored and Shelley Vohr committed 2020-02-17 12:48:31 -08:00
1 parent e37f5100e5
commit 2de085fe93
30 files changed
+75 -80

No files matched your search

+5 -5
View File
@@ -10,23 +10,23 @@ const bench = common.createBenchmark(main, {
function main({ type, n }) {
const input = inputs[type];
var i;
// Execute the function a "sufficient" number of times before the timed
// loop to ensure the function is optimized just once.
if (type === 'multicharsep') {
for (i = 0; i < n; i += 1)
for (let i = 0; i < n; i += 1)
querystring.parse(input, '&&&&&&&&&&');
bench.start();
for (i = 0; i < n; i += 1)
for (let i = 0; i < n; i += 1)
querystring.parse(input, '&&&&&&&&&&');
bench.end(n);
} else {
for (i = 0; i < n; i += 1)
for (let i = 0; i < n; i += 1)
querystring.parse(input);
bench.start();
for (i = 0; i < n; i += 1)
for (let i = 0; i < n; i += 1)
querystring.parse(input);
bench.end(n);
}