Skip to content
Permalink
Browse files

benchmark: swap var for let in util benchmarks

In benchmark util directory this changes for loops using var to let
when it applies for consistency

PR-URL: #28867
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information...
RamirezAlex authored and targos committed Jul 24, 2019
1 parent 048db38 commit f2c1f3613b0d58c8ada1026b6c094d17a383501b
@@ -25,7 +25,7 @@ function main({ n, type }) {
const [first, second] = inputs[type || 'string'];

bench.start();
for (var i = 0; i < n; i++) {
for (let i = 0; i < n; i++) {
util.format(first, second);
}
bench.end(n);
@@ -9,7 +9,7 @@ function main({ n }) {
const proxyA = new Proxy({}, { get: () => {} });
const proxyB = new Proxy(() => {}, {});
bench.start();
for (var i = 0; i < n; i += 1)
for (let i = 0; i < n; i += 1)
util.inspect({ a: proxyA, b: proxyB }, { showProxy: true });
bench.end(n);
}
@@ -30,7 +30,7 @@ const bench = common.createBenchmark(main, {

function benchmark(n, obj, options) {
bench.start();
for (var i = 0; i < n; i += 1) {
for (let i = 0; i < n; i += 1) {
util.inspect(obj, options);
}
bench.end(n);
@@ -25,7 +25,7 @@ function main({ n, pos, size }) {
}

bench.start();
for (var i = 0; i < n; i++) {
for (let i = 0; i < n; i++) {
spliceOne(arr, index);
arr.push('');
}
@@ -45,7 +45,7 @@ function main({ type, argument, version, n }) {
const arg = args[type][argument];

bench.start();
for (var i = 0; i < n; i++) {
for (let i = 0; i < n; i++) {
func(arg);
}
bench.end(n);

0 comments on commit f2c1f36

Please sign in to comment.
You can’t perform that action at this time.