mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
benchmark: (arrays) use destructuring
PR-URL: https://github.com/nodejs/node/pull/18250 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
195bed21eb
commit
3543458988
3 files changed
+3
-9
No files matched your search
@@ -17,10 +17,8 @@ const bench = common.createBenchmark(main, {
|
||||
n: [25]
|
||||
});
|
||||
|
||||
function main(conf) {
|
||||
const type = conf.type;
|
||||
function main({ type, n }) {
|
||||
const clazz = global[type];
|
||||
const n = +conf.n;
|
||||
|
||||
bench.start();
|
||||
const arr = new clazz(n * 1e6);
|
||||
|
||||
@@ -17,10 +17,8 @@ const bench = common.createBenchmark(main, {
|
||||
n: [25]
|
||||
});
|
||||
|
||||
function main(conf) {
|
||||
const type = conf.type;
|
||||
function main({ type, n }) {
|
||||
const clazz = global[type];
|
||||
const n = +conf.n;
|
||||
|
||||
bench.start();
|
||||
const arr = new clazz(n * 1e6);
|
||||
|
||||
@@ -17,10 +17,8 @@ const bench = common.createBenchmark(main, {
|
||||
n: [25]
|
||||
});
|
||||
|
||||
function main(conf) {
|
||||
const type = conf.type;
|
||||
function main({ type, n }) {
|
||||
const clazz = global[type];
|
||||
const n = +conf.n;
|
||||
|
||||
bench.start();
|
||||
const arr = new clazz(n * 1e6);
|
||||
|
||||
Reference in new issue
Block a user