mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
benchmark: tidy up eslint ignore in foreach-bench.js
PR-URL: https://github.com/nodejs/node/pull/26925 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
This commit is contained in:
parent
25d5198001
commit
5512ecb5b0
|
|
@ -12,19 +12,18 @@ function useFor(n, items, count) {
|
|||
bench.start();
|
||||
for (var i = 0; i < n; i++) {
|
||||
for (var j = 0; j < count; j++) {
|
||||
/* eslint-disable no-unused-vars */
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const item = items[j];
|
||||
/* esline-enable no-unused-vars */
|
||||
}
|
||||
}
|
||||
bench.end(n);
|
||||
}
|
||||
|
||||
function useForOf(n, items) {
|
||||
var item;
|
||||
bench.start();
|
||||
for (var i = 0; i < n; i++) {
|
||||
for (item of items) {}
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
for (const item of items) {}
|
||||
}
|
||||
bench.end(n);
|
||||
}
|
||||
|
|
@ -33,9 +32,8 @@ function useForIn(n, items) {
|
|||
bench.start();
|
||||
for (var i = 0; i < n; i++) {
|
||||
for (var j in items) {
|
||||
/* eslint-disable no-unused-vars */
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const item = items[j];
|
||||
/* esline-enable no-unused-vars */
|
||||
}
|
||||
}
|
||||
bench.end(n);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user