Declare locals as final where not reassigned (dev) (#8574)
This commit is contained in:
@@ -54,7 +54,7 @@ class BenchmarkResultPrinter {
|
||||
}
|
||||
|
||||
String _printPlainText() {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
final StringBuffer buf = new StringBuffer();
|
||||
for (_BenchmarkResult result in _results) {
|
||||
buf.writeln('${result.description}: ${result.value.toStringAsFixed(1)} ${result.unit}');
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ void main() {
|
||||
}
|
||||
watch.stop();
|
||||
|
||||
BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
final BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
printer.addResult(
|
||||
description: 'Velocity tracker',
|
||||
value: watch.elapsedMicroseconds / _kNumIters,
|
||||
|
||||
@@ -75,7 +75,7 @@ Future<Null> main() async {
|
||||
}
|
||||
});
|
||||
|
||||
BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
final BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
printer.addResult(
|
||||
description: 'Stock animation',
|
||||
value: wallClockWatch.elapsedMicroseconds / (1000 * 1000),
|
||||
|
||||
@@ -21,7 +21,7 @@ Future<Null> main() async {
|
||||
|
||||
// This allows us to call onBeginFrame even when the engine didn't request it,
|
||||
// and have it actually do something:
|
||||
LiveTestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
|
||||
final LiveTestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
|
||||
binding.allowAllFrames = true;
|
||||
|
||||
final Stopwatch watch = new Stopwatch();
|
||||
@@ -50,7 +50,7 @@ Future<Null> main() async {
|
||||
watch.stop();
|
||||
});
|
||||
|
||||
BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
final BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
printer.addResult(
|
||||
description: 'Stock build',
|
||||
value: watch.elapsedMicroseconds / iterations,
|
||||
|
||||
@@ -20,7 +20,7 @@ Future<Null> main() async {
|
||||
|
||||
// This allows us to call onBeginFrame even when the engine didn't request it,
|
||||
// and have it actually do something:
|
||||
LiveTestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
|
||||
final LiveTestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
|
||||
binding.allowAllFrames = true;
|
||||
|
||||
final Stopwatch watch = new Stopwatch();
|
||||
@@ -51,7 +51,7 @@ Future<Null> main() async {
|
||||
watch.stop();
|
||||
});
|
||||
|
||||
BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
final BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
printer.addResult(
|
||||
description: 'Stock layout',
|
||||
value: watch.elapsedMicroseconds / iterations,
|
||||
|
||||
Reference in New Issue
Block a user