[benchmarks] Update legacy benchmarks to use the List.filled constructor
The legacy Dart 2.9 benchmarks that used the default List(int size) constructor are changed to use the equivalent List.filled(size, null) constructor, because the default List constructor is removed. Bug: b/280275041 Change-Id: I2813537ae22e19d473abde70d677368940585423 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304700 Reviewed-by: Jonas Termansen <sortie@google.com> Commit-Queue: William Hesse <whesse@google.com>
This commit is contained in:
committed by
Commit Queue
parent
783abcd4e8
commit
ea5840c2c5
@@ -45,7 +45,7 @@ class Utf8Encode extends BenchmarkBase {
|
||||
final String repeatedText = originalText * (size / nRunes).ceil();
|
||||
final List<int> runes = repeatedText.runes.toList();
|
||||
final int nChunks = (size < nRunes) ? (nRunes / size).floor() : 1;
|
||||
benchmarkTextChunks = List<String>(nChunks);
|
||||
benchmarkTextChunks = List<String>.filled(nChunks, null);
|
||||
for (int i = 0; i < nChunks; i++) {
|
||||
final offset = i * size;
|
||||
benchmarkTextChunks[i] =
|
||||
|
||||
Reference in New Issue
Block a user