null-safety fixes for ListCopy benchmark setup

Change-Id: I0de8ba7cb1a04aba35a6b722b0fcdd8946ce9737
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140241
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
Stephen Adams 2020-03-20 20:36:13 +00:00 committed by commit-bot@chromium.org
parent 9a90ed0753
commit 13e56c6a3a

View file

@ -56,7 +56,8 @@ class Benchmark extends BenchmarkBase {
while (totalLength < elements) {
var variants = makeVariants();
inputs.addAll(variants);
totalLength += variants.fold(0, (sum, iterable) => sum + iterable.length);
totalLength +=
variants.fold(0, (sum, iterable) => sum + iterable.length) as int;
}
// Sanity checks.
@ -90,7 +91,7 @@ class Benchmark extends BenchmarkBase {
// All the 'copy' methods use [input] and [output] rather than a parameter and
// return value to avoid any possibility of type check in the call sequence.
Iterable<num> input;
Iterable<num> input = const [];
var output;
List<Benchmark> makeBenchmarks(int length) => [