use_is_even_rather_than_modulo (#68301)

This commit is contained in:
Alexandre Ardhuin
2020-10-16 20:20:00 +02:00
committed by GitHub
parent 3393566b56
commit c0176c9ee5
22 changed files with 30 additions and 30 deletions

View File

@@ -21,7 +21,7 @@ void main() {
data.add(
InlineSpanSemanticsInformation(words[i], isPlaceholder: false),
);
} else if (i % 2 == 0) {
} else if (i.isEven) {
data.add(
InlineSpanSemanticsInformation(words[i], isPlaceholder: true),
);

View File

@@ -46,7 +46,7 @@ Future<void> main() async {
watch.start();
while (watch.elapsed < kBenchmarkTime) {
renderView.configuration = (iterations % 2 == 0) ? big : small;
renderView.configuration = iterations.isEven ? big : small;
await tester.pumpBenchmark(Duration(milliseconds: iterations * 16));
iterations += 1;
}