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

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

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

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

2727
functionmain({ n, primitive, method }){
28+
if(!method)
29+
method='deepEqual';
2830
constprim=primValues[primitive];
2931
constactual=prim;
3032
constexpected=prim;
3133
constexpectedWrong='b';
3234

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

3738
bench.start();

0 commit comments

Comments
 (0)