Skip to content

Commit b8470b9

Browse files
TrottMylesBorins
authored andcommitted
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: #21030 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 686587b commit b8470b9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

benchmark/assert/deepequal-typedarrays.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@ const bench = common.createBenchmark(main, {
2525
});
2626

2727
function main({ type, n, len, method }) {
28+
if (!method)
29+
method = 'deepEqual';
2830
const clazz = global[type];
2931
const actual = new clazz(len);
3032
const expected = new clazz(len);
3133
const expectedWrong = Buffer.alloc(len);
3234
const wrongIndex = Math.floor(len / 2);
3335
expectedWrong[wrongIndex] = 123;
3436

35-
// eslint-disable-next-line no-restricted-properties
36-
const fn = method !== '' ? assert[method] : assert.deepEqual;
37+
const fn = assert[method];
3738
const value2 = method.includes('not') ? expectedWrong : expected;
3839

3940
bench.start();

0 commit comments

Comments
 (0)