diff options
author | Rich Trott <rtrott@gmail.com> | 2018-05-30 03:53:11 +0000 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-06-02 05:17:28 +0200 |
commit | b8f8ca570243bb58337e547f7bf10515cfab0ea5 (patch) | |
tree | 2aaaa3b9fb2e8f1e93f97aba87e06601959d6162 /benchmark/assert | |
parent | 9cd4a23b796617e6920072bae5771f1bbdf22197 (diff) | |
download | node-new-b8f8ca570243bb58337e547f7bf10515cfab0ea5.tar.gz |
benchmark: refactor deepequal-typedarrays
This is a minor refactor of benchmark/assert/deepequal-typedarrays.js to
reduce exceptions that need to be made for lint compliance.
PR-URL: https://github.com/nodejs/node/pull/21030
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'benchmark/assert')
-rw-r--r-- | benchmark/assert/deepequal-typedarrays.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/benchmark/assert/deepequal-typedarrays.js b/benchmark/assert/deepequal-typedarrays.js index 50e6e525b2..c4d8f434bf 100644 --- a/benchmark/assert/deepequal-typedarrays.js +++ b/benchmark/assert/deepequal-typedarrays.js @@ -25,6 +25,8 @@ const bench = common.createBenchmark(main, { }); function main({ type, n, len, method }) { + if (!method) + method = 'deepEqual'; const clazz = global[type]; const actual = new clazz(len); const expected = new clazz(len); @@ -32,8 +34,7 @@ function main({ type, n, len, method }) { const wrongIndex = Math.floor(len / 2); expectedWrong[wrongIndex] = 123; - // eslint-disable-next-line no-restricted-properties - const fn = method !== '' ? assert[method] : assert.deepEqual; + const fn = assert[method]; const value2 = method.includes('not') ? expectedWrong : expected; bench.start(); |