Skip to content

Commit f491828

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

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

benchmark/querystring/querystring-parse.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ const bench = common.createBenchmark(main, {
88
n: [1e6],
99
});
1010

11-
function main(conf) {
12-
const type = conf.type;
13-
const n = conf.n | 0;
11+
function main({ type, n }) {
1412
const input = inputs[type];
1513
var i;
1614
// Execute the function a "sufficient" number of times before the timed

benchmark/querystring/querystring-stringify.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ const bench = common.createBenchmark(main, {
77
n: [1e7],
88
});
99

10-
function main(conf) {
11-
const type = conf.type;
12-
const n = conf.n | 0;
13-
10+
function main({ type, n }) {
1411
const inputs = {
1512
noencode: {
1613
foo: 'bar',

benchmark/querystring/querystring-unescapebuffer.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ const bench = common.createBenchmark(main, {
1212
n: [10e6],
1313
});
1414

15-
function main(conf) {
16-
const input = conf.input;
17-
const n = conf.n | 0;
18-
15+
function main({ input, n }) {
1916
bench.start();
2017
for (var i = 0; i < n; i += 1)
2118
querystring.unescapeBuffer(input);

0 commit comments

Comments
 (0)