Skip to content

Commit 90d8658

Browse files
TrottMylesBorins
authored andcommitted
benchmark: refactor deepequal-buffer
This is a minor refactor of benchmark/assert/deepequal-buffer.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 c8ee379 commit 90d8658

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎benchmark/assert/deepequal-buffer.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const bench = common.createBenchmark(main, {
1414
});
1515

1616
functionmain({ len, n, method }){
17+
if(!method)
18+
method='deepEqual';
1719
constdata=Buffer.allocUnsafe(len+1);
1820
constactual=Buffer.alloc(len);
1921
constexpected=Buffer.alloc(len);
@@ -22,8 +24,7 @@ function main({ len, n, method }) {
2224
data.copy(expected);
2325
data.copy(expectedWrong);
2426

25-
// eslint-disable-next-line no-restricted-properties
26-
constfn=method!=='' ? assert[method] : assert.deepEqual;
27+
constfn=assert[method];
2728
constvalue2=method.includes('not') ? expectedWrong : expected;
2829

2930
bench.start();

0 commit comments

Comments
 (0)