summaryrefslogtreecommitdiff
path: root/benchmark/path/isAbsolute-win32.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2017-12-30 03:57:01 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-01-23 01:29:24 +0100
commit92953fa1941937a33abc1830fdbd76d8ec091083 (patch)
tree6166165d85d2a0e13ced9f3c752ca4eedf285bbe /benchmark/path/isAbsolute-win32.js
parent32b3cad5760089a691a534fdb72a22905bb70f90 (diff)
downloadandroid-node-v8-92953fa1941937a33abc1830fdbd76d8ec091083.tar.gz
android-node-v8-92953fa1941937a33abc1830fdbd76d8ec091083.tar.bz2
android-node-v8-92953fa1941937a33abc1830fdbd76d8ec091083.zip
benchmark: (path) 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>
Diffstat (limited to 'benchmark/path/isAbsolute-win32.js')
-rw-r--r--benchmark/path/isAbsolute-win32.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/benchmark/path/isAbsolute-win32.js b/benchmark/path/isAbsolute-win32.js
index 3c93b24220..350e99d48b 100644
--- a/benchmark/path/isAbsolute-win32.js
+++ b/benchmark/path/isAbsolute-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: [
@@ -14,14 +14,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.isAbsolute(input);
+ win32.isAbsolute(path);
}
bench.end(n);
}