Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1455)

Unified Diff: runtime/lib/string_patch.dart

Issue 14868002: Do not copy immutable arrays in String.createFromCharCodes. Tighten the types a little in string_pa… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/string.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string_patch.dart
===================================================================
--- runtime/lib/string_patch.dart (revision 22334)
+++ runtime/lib/string_patch.dart (working copy)
@@ -27,9 +27,13 @@
* [codePoints].
*/
static String createFromCharCodes(Iterable<int> charCodes) {
- if (charCodes is! _ObjectArray && charCodes is! _GrowableObjectArray) {
+ // TODO(srdjan): Also skip copying of typed arrays.
+ if (charCodes is! _ObjectArray &&
Ivan Posva 2013/05/03 15:44:27 This will not work long-term. Especially once we h
srdjan 2013/05/03 16:44:47 Good point. What is the ETA for "implements dynami
+ charCodes is! _GrowableObjectArray &&
+ charCodes is! _ImmutableArray) {
charCodes = new List<int>.from(charCodes, growable: false);
}
+
return _createFromCodePoints(charCodes);
}
@@ -314,7 +318,7 @@
*/
static String _interpolate(List values) {
int numValues = values.length;
- var stringList = new List(numValues);
+ _ObjectArray stringList = new List(numValues);
for (int i = 0; i < numValues; i++) {
stringList[i] = values[i].toString();
}
@@ -428,7 +432,7 @@
return _concatAll(stringsArray);
}
- static String _concatAll(List<String> strings)
+ static String _concatAll(_ObjectArray<String> strings)
native "Strings_concatAll";
}
« no previous file with comments | « runtime/lib/string.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698