From 92953fa1941937a33abc1830fdbd76d8ec091083 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Sat, 30 Dec 2017 03:57:01 +0100 Subject: benchmark: (path) use destructuring PR-URL: https://github.com/nodejs/node/pull/18250 Reviewed-By: Matteo Collina Reviewed-By: James M Snell --- benchmark/path/dirname-win32.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'benchmark/path/dirname-win32.js') diff --git a/benchmark/path/dirname-win32.js b/benchmark/path/dirname-win32.js index c09a3aff98..f47abdd379 100644 --- a/benchmark/path/dirname-win32.js +++ b/benchmark/path/dirname-win32.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common.js'); -const path = require('path'); +const { win32 } = require('path'); const bench = common.createBenchmark(main, { path: [ @@ -15,14 +15,10 @@ const bench = common.createBenchmark(main, { n: [1e6] }); -function main(conf) { - const n = +conf.n; - const p = path.win32; - const input = String(conf.path); - +function main({ n, path }) { bench.start(); for (var i = 0; i < n; i++) { - p.dirname(input); + win32.dirname(path); } bench.end(n); } -- cgit v1.2.1