Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 391fe46

Browse filesBrowse files
RamirezAlextargos
authored andcommitted
benchmark, http: refactor for code consistency
In benchmark http directory this changes for loops using var to let when it applies for consistency PR-URL: #28791 Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 470db47 commit 391fe46
Copy full SHA for 391fe46

File tree

Expand file treeCollapse file tree

4 files changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎benchmark/http/bench-parser.js‎

Copy file name to clipboardExpand all lines: benchmark/http/bench-parser.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function main({ len, n }) {
2222
const parser = newParser(REQUEST);
2323

2424
bench.start();
25-
for (var i = 0; i < n; i++) {
25+
for (let i = 0; i < n; i++) {
2626
parser.execute(header, 0, header.length);
2727
parser.initialize(REQUEST, {});
2828
}
@@ -45,7 +45,7 @@ function main({ len, n }) {
4545

4646
let header = `GET /hello HTTP/1.1${CRLF}Content-Type: text/plain${CRLF}`;
4747

48-
for (var i = 0; i < len; i++) {
48+
for (let i = 0; i < len; i++) {
4949
header += `X-Filler${i}: ${Math.random().toString(36).substr(2)}${CRLF}`;
5050
}
5151
header += CRLF;
Collapse file

‎benchmark/http/check_invalid_header_char.js‎

Copy file name to clipboardExpand all lines: benchmark/http/check_invalid_header_char.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function main({ n, input }) {
6161

6262
const len = inputs.length;
6363
bench.start();
64-
for (var i = 0; i < n; i++) {
64+
for (let i = 0; i < n; i++) {
6565
_checkInvalidHeaderChar(inputs[i % len]);
6666
}
6767
bench.end(n);
Collapse file

‎benchmark/http/check_is_http_token.js‎

Copy file name to clipboardExpand all lines: benchmark/http/check_is_http_token.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const bench = common.createBenchmark(main, {
4242

4343
function main({ n, key }) {
4444
bench.start();
45-
for (var i = 0; i < n; i++) {
45+
for (let i = 0; i < n; i++) {
4646
_checkIsHttpToken(key);
4747
}
4848
bench.end(n);
Collapse file

‎benchmark/http/set_header.js‎

Copy file name to clipboardExpand all lines: benchmark/http/set_header.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function main(conf) {
2323
const og = new OutgoingMessage();
2424

2525
bench.start();
26-
for (var i = 0; i < n; i++) {
26+
for (let i = 0; i < n; i++) {
2727
og.setHeader(value, '');
2828
}
2929
bench.end(n);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.