diff options
author | Alex Ramirez <alexander.ramirez@gmail.com> | 2019-07-24 17:24:57 -0500 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-07-30 09:38:00 -0700 |
commit | d349ba29ef00e77a9e379dc452a2de798975a4e3 (patch) | |
tree | 60e7dd680a4e55b9e2312c28fa6fe7716988404f /benchmark | |
parent | 0d1b14ac194bc50297c871907c8b5a87d69a08b1 (diff) | |
download | android-node-v8-d349ba29ef00e77a9e379dc452a2de798975a4e3.tar.gz android-node-v8-d349ba29ef00e77a9e379dc452a2de798975a4e3.tar.bz2 android-node-v8-d349ba29ef00e77a9e379dc452a2de798975a4e3.zip |
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: https://github.com/nodejs/node/pull/28867
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/util/format.js | 2 | ||||
-rw-r--r-- | benchmark/util/inspect-proxy.js | 2 | ||||
-rw-r--r-- | benchmark/util/inspect.js | 2 | ||||
-rw-r--r-- | benchmark/util/splice-one.js | 2 | ||||
-rw-r--r-- | benchmark/util/type-check.js | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/benchmark/util/format.js b/benchmark/util/format.js index 2a4a20097c..44e950a6ca 100644 --- a/benchmark/util/format.js +++ b/benchmark/util/format.js @@ -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); diff --git a/benchmark/util/inspect-proxy.js b/benchmark/util/inspect-proxy.js index 3c82d50ac3..dde86941ff 100644 --- a/benchmark/util/inspect-proxy.js +++ b/benchmark/util/inspect-proxy.js @@ -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); } diff --git a/benchmark/util/inspect.js b/benchmark/util/inspect.js index fd6f6158cd..159d831f76 100644 --- a/benchmark/util/inspect.js +++ b/benchmark/util/inspect.js @@ -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); diff --git a/benchmark/util/splice-one.js b/benchmark/util/splice-one.js index 4ca7c8564d..6a5a634640 100644 --- a/benchmark/util/splice-one.js +++ b/benchmark/util/splice-one.js @@ -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(''); } diff --git a/benchmark/util/type-check.js b/benchmark/util/type-check.js index f11471980d..5b992e729e 100644 --- a/benchmark/util/type-check.js +++ b/benchmark/util/type-check.js @@ -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); |