[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:
William Hesse
2023-05-22 14:14:42 +00:00
committed by Commit Queue
parent 783abcd4e8
commit ea5840c2c5
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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] =