Skip to content

Commit 3543458

Browse files
BridgeARevanlucas
authored andcommitted
benchmark: (arrays) use destructuring
PR-URL: #18250 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 195bed2 commit 3543458

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

benchmark/arrays/var-int.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ const bench = common.createBenchmark(main, {
1717
n: [25]
1818
});
1919

20-
function main(conf) {
21-
const type = conf.type;
20+
function main({ type, n }) {
2221
const clazz = global[type];
23-
const n = +conf.n;
2422

2523
bench.start();
2624
const arr = new clazz(n * 1e6);

benchmark/arrays/zero-float.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ const bench = common.createBenchmark(main, {
1717
n: [25]
1818
});
1919

20-
function main(conf) {
21-
const type = conf.type;
20+
function main({ type, n }) {
2221
const clazz = global[type];
23-
const n = +conf.n;
2422

2523
bench.start();
2624
const arr = new clazz(n * 1e6);

benchmark/arrays/zero-int.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ const bench = common.createBenchmark(main, {
1717
n: [25]
1818
});
1919

20-
function main(conf) {
21-
const type = conf.type;
20+
function main({ type, n }) {
2221
const clazz = global[type];
23-
const n = +conf.n;
2422

2523
bench.start();
2624
const arr = new clazz(n * 1e6);

0 commit comments

Comments
 (0)