benchmark: (string_decoder) 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:
Ruben Bridgewater
2017-12-30 03:57:10 +01:00
parent 92953fa194
commit fa3149308e
2 changed files with 4 additions and 12 deletions

View File

@@ -9,10 +9,7 @@ const bench = common.createBenchmark(main, {
n: [25e6]
});
function main(conf) {
const encoding = conf.encoding;
const n = conf.n | 0;
function main({ encoding, n }) {
bench.start();
for (var i = 0; i < n; ++i) {
const sd = new StringDecoder(encoding);