Skip to content

Commit

Permalink
benchmarks: fix benchmark for url
Browse files Browse the repository at this point in the history
  • Loading branch information
daynin committed Mar 2, 2018
1 parent 740c426 commit a4e954c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions benchmark/url/url-searchparams-read.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ const str = 'one=single&two=first&three=first&two=2nd&three=2nd&three=3rd';

function main({ method, param, n }) {
const params = new URLSearchParams(str);
const fn = params[method];
if (!fn)
if (!params[method])
throw new Error(`Unknown method ${method}`);

bench.start();
for (var i = 0; i < n; i += 1)
fn(param);
params[method](param);
bench.end(n);
}

0 comments on commit a4e954c

Please sign in to comment.