benchmark: refactor for consistent style

Code in benchmark directory sometimes uses `function () {}` for
anonymous callbacks and sometimes uses `() => {}`. Multi-line arrays
sometimes have a trailing comma and sometimes do not. Update to always
use arrow functions for anonymous callbacks and trailing commas for
multiline arrays.

PR-URL: https://github.com/nodejs/node/pull/25944
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Rich Trott
2019-02-04 22:06:08 -08:00
parent d310d8df62
commit 29e74d4952
96 changed files with 158 additions and 164 deletions

View File

@@ -13,7 +13,7 @@ const bench = common.createBenchmark(main, {
'foo/bar.',
['foo/bar.', '.'].join('|'),
'/foo/bar/baz/asdf/quux.html',
['/foo/bar/baz/asdf/quux.html', '.html'].join('|')
['/foo/bar/baz/asdf/quux.html', '.html'].join('|'),
],
n: [1e6]
});

View File

@@ -13,7 +13,7 @@ const bench = common.createBenchmark(main, {
'foo\\bar.',
['foo\\bar.', '.'].join('|'),
'\\foo\\bar\\baz\\asdf\\quux.html',
['\\foo\\bar\\baz\\asdf\\quux.html', '.html'].join('|')
['\\foo\\bar\\baz\\asdf\\quux.html', '.html'].join('|'),
],
n: [1e6]
});

View File

@@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
'/foo/bar',
'foo',
'foo/bar',
'/foo/bar/baz/asdf/quux'
'/foo/bar/baz/asdf/quux',
],
n: [1e6]
});

View File

@@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
'C:\\foo\\bar',
'foo',
'foo\\bar',
'D:\\foo\\bar\\baz\\asdf\\quux'
'D:\\foo\\bar\\baz\\asdf\\quux',
],
n: [1e6]
});

View File

@@ -13,7 +13,7 @@ const bench = common.createBenchmark(main, {
'foo/bar/..baz.quux',
'foo/bar/...baz.quux',
'/foo/bar/baz/asdf/quux',
'/foo/bar/baz/asdf/quux.foobarbazasdfquux'
'/foo/bar/baz/asdf/quux.foobarbazasdfquux',
],
n: [1e6]
});

View File

@@ -13,7 +13,7 @@ const bench = common.createBenchmark(main, {
'foo\\bar\\..baz.quux',
'foo\\bar\\...baz.quux',
'D:\\foo\\bar\\baz\\asdf\\quux',
'\\foo\\bar\\baz\\asdf\\quux.foobarbazasdfquux'
'\\foo\\bar\\baz\\asdf\\quux.foobarbazasdfquux',
],
n: [1e6]
});

View File

@@ -4,7 +4,7 @@ const { posix } = require('path');
const bench = common.createBenchmark(main, {
props: [
['/', '/home/user/dir', 'index.html', '.html', 'index'].join('|')
['/', '/home/user/dir', 'index.html', '.html', 'index'].join('|'),
],
n: [1e7]
});

View File

@@ -4,7 +4,7 @@ const { win32 } = require('path');
const bench = common.createBenchmark(main, {
props: [
['C:\\', 'C:\\path\\dir', 'index.html', '.html', 'index'].join('|')
['C:\\', 'C:\\path\\dir', 'index.html', '.html', 'index'].join('|'),
],
n: [1e7]
});

View File

@@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, {
'.',
'/foo/bar',
'/baz/..',
'bar/baz'
'bar/baz',
],
n: [1e6]
});

View File

@@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, {
'//server',
'C:\\baz\\..',
'C:baz\\..',
'bar\\baz'
'bar\\baz',
],
n: [1e6]
});

View File

@@ -4,7 +4,7 @@ const { posix } = require('path');
const bench = common.createBenchmark(main, {
paths: [
['/foo', 'bar', '', 'baz/asdf', 'quux', '..'].join('|')
['/foo', 'bar', '', 'baz/asdf', 'quux', '..'].join('|'),
],
n: [1e6]
});

View File

@@ -4,7 +4,7 @@ const { win32 } = require('path');
const bench = common.createBenchmark(main, {
paths: [
['C:\\foo', 'bar', '', 'baz\\asdf', 'quux', '..'].join('|')
['C:\\foo', 'bar', '', 'baz\\asdf', 'quux', '..'].join('|'),
],
n: [1e6]
});

View File

@@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {
'foo\\bar',
'C:\\foo',
'\\\\foo\\bar',
'\\\\?\\foo'
'\\\\?\\foo',
],
n: [1e6]
});

View File

@@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, {
'/../',
'/foo',
'/foo/bar',
'/foo/bar//baz/asdf/quux/..'
'/foo/bar//baz/asdf/quux/..',
],
n: [1e6]
});

View File

@@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, {
'C:\\..\\',
'C:\\foo',
'C:\\foo\\bar',
'C:\\foo\\bar\\\\baz\\asdf\\quux\\..'
'C:\\foo\\bar\\\\baz\\asdf\\quux\\..',
],
n: [1e6]
});

View File

@@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
'/foo/bar.baz',
'foo/.bar.baz',
'foo/bar',
'/foo/bar/baz/asdf/.quux'
'/foo/bar/baz/asdf/.quux',
],
n: [1e6]
});

View File

@@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, {
'E:\\foo\\bar.baz',
'foo\\.bar.baz',
'foo\\bar',
'\\foo\\bar\\baz\\asdf\\.quux'
'\\foo\\bar\\baz\\asdf\\.quux',
],
n: [1e6]
});

View File

@@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
['/var', '/bin'].join('|'),
['/foo/bar/baz/quux', '/'].join('|'),
['/foo/bar/baz/quux', '/foo/bar/baz/quux'].join('|'),
['/foo/bar/baz/quux', '/var/log'].join('|')
['/foo/bar/baz/quux', '/var/log'].join('|'),
],
n: [1e6]
});

View File

@@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, {
['C:\\', 'D:\\'].join('|'),
['C:\\foo\\bar\\baz', 'C:\\foo\\bar\\baz'].join('|'),
['C:\\foo\\BAR\\BAZ', 'C:\\foo\\bar\\baz'].join('|'),
['C:\\foo\\bar\\baz\\quux', 'C:\\'].join('|')
['C:\\foo\\bar\\baz\\quux', 'C:\\'].join('|'),
],
n: [1e6]
});

View File

@@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {
'',
['', ''].join('|'),
['foo/bar', '/tmp/file/', '..', 'a/../subfile'].join('|'),
['a/b/c/', '../../..'].join('|')
['a/b/c/', '../../..'].join('|'),
],
n: [1e6]
});

View File

@@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {
'',
['', ''].join('|'),
['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'].join('|'),
['c:/blah\\blah', 'd:/games', 'c:../a'].join('|')
['c:/blah\\blah', 'd:/games', 'c:../a'].join('|'),
],
n: [1e6]
});