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

Unified Diff: runtime/lib/string_base.dart

Issue 11416270: Implement faster splitting with empty string as pattern. Add special native for computing substring… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string_base.dart
===================================================================
--- runtime/lib/string_base.dart (revision 15545)
+++ runtime/lib/string_base.dart (working copy)
@@ -269,6 +269,9 @@
}
List<String> split(Pattern pattern) {
+ if ((pattern is String) && pattern.isEmpty) {
+ return splitChars();
+ }
int length = this.length;
Iterator iterator = pattern.allMatches(this).iterator();
if (length == 0 && iterator.hasNext) {
@@ -375,6 +378,8 @@
((9 <= codePoint) && (codePoint <= 13)); // CR, LF, TAB, etc.
}
+ String _substringUnchecked(int startIndex, int endIndex)
+ native "OneByteString_substringUnchecked";
}
« no previous file with comments | « runtime/lib/string.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698