Skip to content

Commit

Permalink
benchmark: tidy up eslint ignore in foreach-bench.js
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
gengjiawen authored and BethGriggs committed Apr 8, 2019
1 parent 25d5198 commit 5512ecb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions benchmark/es/foreach-bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down

0 comments on commit 5512ecb

Please sign in to comment.