Index: utils/tests/string_encoding/benchmark_runner.dart |
diff --git a/utils/tests/string_encoding/benchmark_runner.dart b/utils/tests/string_encoding/benchmark_runner.dart |
index de90cf5b43e21006d1a8506102f4066bf6e4344e..f29c4f994d16ea86d07a45583c2d5df6af2965d7 100644 |
--- a/utils/tests/string_encoding/benchmark_runner.dart |
+++ b/utils/tests/string_encoding/benchmark_runner.dart |
@@ -168,15 +168,13 @@ class TestReport { |
} |
String _leftAlign(String s, int width) { |
- List<int> outCodes = []; |
- outCodes.insertRange(0, width, spaceChar); |
+ List<int> outCodes = new List<int>.filled(width, spaceChar); |
outCodes.setRange(0, Math.min(width, s.length), s.codeUnits); |
return new String.fromCharCodes(outCodes); |
} |
String _rightAlign(String s, int width) { |
- List<int> outCodes = []; |
- outCodes.insertRange(0, width, spaceChar); |
+ List<int> outCodes = new List<int>.filled(width, spaceChar); |
int fromIndex = Math.max(0, width - s.length); |
int length = Math.min(width, s.length); |
outCodes.setRange(fromIndex, fromIndex + length, s.codeUnits); |