mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 16:47:20 +00:00
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:
parent
9a90ed0753
commit
13e56c6a3a
|
@ -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) => [
|
||||
|
|
Loading…
Reference in a new issue