From f4918289e74d843e808d33941374f7a3dbdc8b54 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Sat, 30 Dec 2017 03:56:18 +0100 Subject: [PATCH] benchmark: (querystring) use destructuring PR-URL: https://github.com/nodejs/node/pull/18250 Reviewed-By: Matteo Collina Reviewed-By: James M Snell --- benchmark/querystring/querystring-parse.js | 4 +--- benchmark/querystring/querystring-stringify.js | 5 +---- benchmark/querystring/querystring-unescapebuffer.js | 5 +---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/benchmark/querystring/querystring-parse.js b/benchmark/querystring/querystring-parse.js index 740dfc9d21b173..db650165eb9cda 100644 --- a/benchmark/querystring/querystring-parse.js +++ b/benchmark/querystring/querystring-parse.js @@ -8,9 +8,7 @@ const bench = common.createBenchmark(main, { n: [1e6], }); -function main(conf) { - const type = conf.type; - const n = conf.n | 0; +function main({ type, n }) { const input = inputs[type]; var i; // Execute the function a "sufficient" number of times before the timed diff --git a/benchmark/querystring/querystring-stringify.js b/benchmark/querystring/querystring-stringify.js index 97b8f1fc703ba2..cd1debd4df622d 100644 --- a/benchmark/querystring/querystring-stringify.js +++ b/benchmark/querystring/querystring-stringify.js @@ -7,10 +7,7 @@ const bench = common.createBenchmark(main, { n: [1e7], }); -function main(conf) { - const type = conf.type; - const n = conf.n | 0; - +function main({ type, n }) { const inputs = { noencode: { foo: 'bar', diff --git a/benchmark/querystring/querystring-unescapebuffer.js b/benchmark/querystring/querystring-unescapebuffer.js index e37af180eef0ea..4f73ed024b11b1 100644 --- a/benchmark/querystring/querystring-unescapebuffer.js +++ b/benchmark/querystring/querystring-unescapebuffer.js @@ -12,10 +12,7 @@ const bench = common.createBenchmark(main, { n: [10e6], }); -function main(conf) { - const input = conf.input; - const n = conf.n | 0; - +function main({ input, n }) { bench.start(); for (var i = 0; i < n; i += 1) querystring.unescapeBuffer(input);