Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell authored Feb 3, 2025
1 parent ce74a22 commit 4c0d9b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion benchmark/url/urlpattern-parse.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
const common = require('../common.js');
const { URLPattern } = require('url');
const { ok } = require('assert');

const tests = [
'https://(sub.)?example(.com/)foo',
Expand All @@ -19,7 +20,8 @@ function main({ pattern, n }) {
const inputPattern = JSON.parse(pattern);
bench.start();
for (let i = 0; i < n; i += 1) {
new URLPattern(inputPattern);
const p = new URLPattern(inputPattern);
ok(p);
}
bench.end(n);
}
4 changes: 3 additions & 1 deletion benchmark/url/urlpattern-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
const common = require('../common.js');
const { URLPattern } = require('url');
const { notStrictEqual } = require('assert');

const tests = [
'https://(sub.)?example(.com/)foo',
Expand All @@ -21,7 +22,8 @@ function main({ pattern, n }) {

bench.start();
for (let i = 0; i < n; i += 1) {
urlpattern.test('https://sub.example.com/foo');
const p = urlpattern.test('https://sub.example.com/foo');
notStrictEqual(p, undefined); // we don't care if it is true or false.

Check failure on line 26 in benchmark/url/urlpattern-test.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Comments should not begin with a lowercase character
}
bench.end(n);
}

0 comments on commit 4c0d9b7

Please sign in to comment.