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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent c8ee379 commit 90d8658

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

benchmark/assert/deepequal-buffer.js

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

1616
function main({ len, n, method }) {
17+
if (!method)
18+
method = 'deepEqual';
1719
const data = Buffer.allocUnsafe(len + 1);
1820
const actual = Buffer.alloc(len);
1921
const expected = 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-
const fn = method !== '' ? assert[method] : assert.deepEqual;
27+
const fn = assert[method];
2728
const value2 = method.includes('not') ? expectedWrong : expected;
2829

2930
bench.start();

0 commit comments

Comments
 (0)