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 <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 686587b commit b8470b9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎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
functionmain({ type, n, len, method }){
28+
if(!method)
29+
method='deepEqual';
2830
constclazz=global[type];
2931
constactual=newclazz(len);
3032
constexpected=newclazz(len);
3133
constexpectedWrong=Buffer.alloc(len);
3234
constwrongIndex=Math.floor(len/2);
3335
expectedWrong[wrongIndex]=123;
3436

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

3940
bench.start();

0 commit comments

Comments
 (0)