Skip to content

Commit 56c6759

Browse files
TrottMylesBorins
authored andcommitted
benchmark: refactor prims-and-objs-big-loop
This is a minor refactor of benchmark/assert/deepequal-prims-and-objs-big-loop.js to reduce exceptions that need to be made for lint compliance. PR-URL: #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>
1 parent 6fbb00e commit 56c6759

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

benchmark/assert/deepequal-prims-and-objs-big-loop.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ const bench = common.createBenchmark(main, {
2525
});
2626

2727
function main({ n, primitive, method }) {
28+
if (!method)
29+
method = 'deepEqual';
2830
const prim = primValues[primitive];
2931
const actual = prim;
3032
const expected = prim;
3133
const expectedWrong = 'b';
3234

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

3738
bench.start();

0 commit comments

Comments
 (0)