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

Unified Diff: runtime/lib/string.dart

Issue 10874038: Make StringBase._substringUnchecked a native function. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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') | 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.dart
===================================================================
--- runtime/lib/string.dart (revision 11257)
+++ runtime/lib/string.dart (working copy)
@@ -152,17 +152,11 @@
if (startIndex > endIndex) {
throw new IndexOutOfRangeException(startIndex);
}
- return substringUnchecked_(startIndex, endIndex);
+ return _substringUnchecked(startIndex, endIndex);
}
- String substringUnchecked_(int startIndex, int endIndex) {
- int len = endIndex - startIndex;
- List<int> charCodes = new List<int>(len);
- for (int i = 0; i < len; i++) {
- charCodes[i] = this.charCodeAt(startIndex + i);
- }
- return StringBase.createFromCharCodes(charCodes);
- }
+ String _substringUnchecked(int startIndex, int endIndex)
+ native "StringBase_substringUnchecked";
String trim() {
final int len = this.length;
@@ -187,7 +181,7 @@
// whitespaces.
return this;
} else {
- return substringUnchecked_(first, last + 1);
+ return _substringUnchecked(first, last + 1);
}
}
« 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