Skip to content

Commit a14e056

Browse files
committed
benchmark: ensure integer division in http headers benchmark
- Parse division result to integer in Array constructor to prevent floating point array length
1 parent 32bd1cf commit a14e056

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

benchmark/http/headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function main({ len, n, duration }) {
2727
'Transfer-Encoding': 'chunked',
2828
};
2929

30-
const Is = [...Array(n / len).keys()];
30+
const Is = [...Array(parseInt(n / len)).keys()];
3131
const Js = [...Array(len).keys()];
3232

3333
for (const i of Is) {

0 commit comments

Comments
 (0)