Chromium Code Reviews| Index: runtime/lib/string_base.dart |
| diff --git a/runtime/lib/string_base.dart b/runtime/lib/string_base.dart |
| index 8ed74b6413dd969022f5494f14818512e1c5c3b0..545c16443ca41bc84bf2f083d22b9ef61c684278 100644 |
| --- a/runtime/lib/string_base.dart |
| +++ b/runtime/lib/string_base.dart |
| @@ -19,18 +19,11 @@ class _StringBase { |
| * Create the most efficient string representation for specified |
| * [codePoints]. |
| */ |
| - static String createFromCharCodes(List<int> charCodes) { |
| - _ObjectArray objectArray; |
| - if (charCodes is _ObjectArray) { |
| - objectArray = charCodes; |
| - } else { |
| - int len = charCodes.length; |
| - objectArray = new _ObjectArray(len); |
| - for (int i = 0; i < len; i++) { |
| - objectArray[i] = charCodes[i]; |
| - } |
| + static String createFromCharCodes(Iterable<int> charCodes) { |
| + if (charCodes is! _ObjectArray) { |
| + charCodes = new List<int>.from(charCodes, growable: false); |
|
floitsch
2013/03/05 14:14:04
assert that it is an _ObjectArray afterwards. (It'
|
| } |
| - return _createFromCodePoints(objectArray); |
| + return _createFromCodePoints(charCodes); |
| } |
| static String _createFromCodePoints(List<int> codePoints) |