use_is_even_rather_than_modulo (#68301)
This commit is contained in:
committed by
GitHub
parent
3393566b56
commit
c0176c9ee5
@@ -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),
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user