Skip to content

Commit

Permalink
benchmark: refactor prims-and-objs-big-loop
Browse files Browse the repository at this point in the history
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: nodejs#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>
  • Loading branch information
Trott committed Jun 2, 2018
1 parent 7bfc00d commit 30650a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions benchmark/assert/deepequal-prims-and-objs-big-loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ const bench = common.createBenchmark(main, {
});

function main({ n, primitive, method }) {
if (!method)
method = 'deepEqual';
const prim = primValues[primitive];
const actual = prim;
const expected = prim;
const expectedWrong = 'b';

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

bench.start();
Expand Down

0 comments on commit 30650a6

Please sign in to comment.