benchmark: enable assert benchmark with short len
`deepequal-typedarrays.js` throws if `len` is set to 100 or less due to a hardcoded index. Calculate the index based on `len` so benchmark can be run with small `len` values if desired. PR-URL: https://github.com/nodejs/node/pull/15174 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
0fc402b992
commit
11f46a2586
@ -33,7 +33,8 @@ function main(conf) {
|
||||
const actual = new clazz(len);
|
||||
const expected = new clazz(len);
|
||||
const expectedWrong = Buffer.alloc(len);
|
||||
expectedWrong[100] = 123;
|
||||
const wrongIndex = Math.floor(len / 2);
|
||||
expectedWrong[wrongIndex] = 123;
|
||||
var i;
|
||||
|
||||
switch (conf.method) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user