GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — benchmark: avoid input param manipulation · nodejs/node@abe2eb9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark/assert
    • deepequal-object.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎benchmark/assert/deepequal-object.js‎

Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-object.js
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ function createObj(source, add = '') {
2424
}
2525

2626
function main({ size, n, method, strict }) {
27-
// TODO: Fix this "hack". `n` should not be manipulated.
28-
n = Math.min(Math.ceil(n / size), 20);
27+
const len = Math.min(Math.ceil(n / size), 20);
2928

3029
const source = Array.apply(null, Array(size));
3130
const actual = createObj(source);
@@ -39,8 +38,8 @@ function main({ size, n, method, strict }) {
3938
const value2 = method.includes('not') ? expectedWrong : expected;
4039

4140
bench.start();
42-
for (let i = 0; i < n; ++i) {
41+
for (let i = 0; i < len; ++i) {
4342
fn(actual, value2);
4443
}
45-
bench.end(n);
44+
bench.end(len);
4645
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.