summaryrefslogtreecommitdiff
path: root/benchmark/assert/deepequal-typedarrays.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2017-12-30 03:54:30 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-01-23 01:29:15 +0100
commit366fd03af00407e9b45d91d9df66b3ab34b10f35 (patch)
treecde109f3a384d1055bc71322d6fc2f1347d759f5 /benchmark/assert/deepequal-typedarrays.js
parent0beef3f03032a97bb0bda1539add7506a11cf2a8 (diff)
downloadandroid-node-v8-366fd03af00407e9b45d91d9df66b3ab34b10f35.tar.gz
android-node-v8-366fd03af00407e9b45d91d9df66b3ab34b10f35.tar.bz2
android-node-v8-366fd03af00407e9b45d91d9df66b3ab34b10f35.zip
benchmark: (assert) 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>
Diffstat (limited to 'benchmark/assert/deepequal-typedarrays.js')
-rw-r--r--benchmark/assert/deepequal-typedarrays.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/benchmark/assert/deepequal-typedarrays.js b/benchmark/assert/deepequal-typedarrays.js
index 8e8cc4b083..01546801ff 100644
--- a/benchmark/assert/deepequal-typedarrays.js
+++ b/benchmark/assert/deepequal-typedarrays.js
@@ -24,12 +24,8 @@ const bench = common.createBenchmark(main, {
len: [1e6]
});
-function main(conf) {
- const type = conf.type;
+function main({ type, n, len, method }) {
const clazz = global[type];
- const n = +conf.n;
- const len = +conf.len;
-
const actual = new clazz(len);
const expected = new clazz(len);
const expectedWrong = Buffer.alloc(len);
@@ -37,7 +33,7 @@ function main(conf) {
expectedWrong[wrongIndex] = 123;
var i;
- switch (conf.method) {
+ switch (method) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'deepEqual':