summaryrefslogtreecommitdiff
path: root/benchmark/util
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-01-23 13:19:30 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-01 10:49:04 +0100
commit1b6cb947611de5865641d1a6780ee6930a4e1d69 (patch)
tree279384c2b3bde394f8a8b3f543fdc0725ef1b93f /benchmark/util
parentc713f079f1bd1c575487c693f3f9244bed460ee1 (diff)
downloadnode-new-1b6cb947611de5865641d1a6780ee6930a4e1d69.tar.gz
benchmark: refactor
PR-URL: https://github.com/nodejs/node/pull/18320 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark/util')
-rw-r--r--benchmark/util/format.js4
-rw-r--r--benchmark/util/inspect-array.js5
2 files changed, 3 insertions, 6 deletions
diff --git a/benchmark/util/format.js b/benchmark/util/format.js
index 5f9c4c3b59..042b8a93cc 100644
--- a/benchmark/util/format.js
+++ b/benchmark/util/format.js
@@ -22,9 +22,7 @@ const bench = common.createBenchmark(main, {
function main({ n, type }) {
// For testing, if supplied with an empty type, default to string.
- type = type || 'string';
-
- const [first, second] = inputs[type];
+ const [first, second] = inputs[type || 'string'];
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/util/inspect-array.js b/benchmark/util/inspect-array.js
index 74332d1857..8b3c54aeb9 100644
--- a/benchmark/util/inspect-array.js
+++ b/benchmark/util/inspect-array.js
@@ -18,14 +18,13 @@ function main({ n, len, type }) {
var arr = Array(len);
var i, opts;
- // For testing, if supplied with an empty type, default to denseArray.
- type = type || 'denseArray';
-
switch (type) {
case 'denseArray_showHidden':
opts = { showHidden: true };
arr = arr.fill('denseArray');
break;
+ // For testing, if supplied with an empty type, default to denseArray.
+ case '':
case 'denseArray':
arr = arr.fill('denseArray');
break;