Chromium Code Reviews| Index: runtime/lib/string_patch.dart |
| =================================================================== |
| --- runtime/lib/string_patch.dart (revision 28056) |
| +++ runtime/lib/string_patch.dart (working copy) |
| @@ -395,9 +395,9 @@ |
| * Convert all objects in [values] to strings and concat them |
| * into a result string. |
| */ |
| - static String _interpolate(List values) { |
| + static String _interpolate(List<String> values) { |
| final int numValues = values.length; |
| - _ObjectArray stringList = new List(numValues); |
| + _ObjectArray stringList = new List<String>(numValues); |
| bool isOneByteString = true; |
| int totalLength = 0; |
| for (int i = 0; i < numValues; i++) { |
| @@ -412,7 +412,7 @@ |
| if (isOneByteString) { |
| return _OneByteString._concatAll(stringList, totalLength); |
| } |
| - return _concatAllNative(stringList); |
| + return _concatAllNative(stringList, 0, stringList.length); |
| } |
| Iterable<Match> allMatches(String str) { |
| @@ -497,8 +497,9 @@ |
| String toLowerCase() native "String_toLowerCase"; |
| - // Call this method if not all list elements are OneByteString-s. |
| - static String _concatAllNative(_ObjectArray<String> strings) |
| + // Call this method if not all list elements are known to be OneByteString-s. |
|
siva
2013/09/30 18:27:21
should this be OneByteString(s).
srdjan
2013/10/01 14:57:44
Done.
|
| + // 'strings' must be an _ObjectArray or _GrowableObjectArray. |
| + static String _concatAllNative(List<String> strings, int start, int end) |
| native "Strings_concatAll"; |
| } |
| @@ -535,7 +536,7 @@ |
| // TODO(srdjan): Improve code below and raise or eliminate the limit. |
| if (totalLength > 128) { |
| // Native is quicker. |
| - return _StringBase._concatAllNative(strings); |
| + return _StringBase._concatAllNative(strings, 0, strings.length); |
| } |
| var res = _OneByteString._allocate(totalLength); |
| final stringsLength = strings.length; |