mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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:
1 parent
e37f5100e5
commit
2de085fe93
30 files changed
+75
-80
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user