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

Unified Diff: runtime/lib/string_patch.dart

Issue 41573003: Specialize string equality for various string classes. Implement intrinsics for string equal… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | « no previous file | runtime/vm/intrinsifier.h » ('j') | 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 29225)
+++ runtime/lib/string_patch.dart (working copy)
@@ -89,9 +89,16 @@
// TODO(5413632): Compare hash codes when both are present.
return false;
}
- return this.compareTo(other) == 0;
+ final len = this.length;
+ for (int i = 0; i < len; i++) {
+ if (this.codeUnitAt(i) != other.codeUnitAt(i)) {
+ return false;
+ }
+ }
+ return true;
}
+
int compareTo(String other) {
int thisLength = this.length;
int otherLength = other.length;
@@ -523,6 +530,10 @@
return _StringBase._isOneByteWhitespace(codePoint);
}
+ bool operator ==(Object other) {
+ return super == other;
+ }
+
String _substringUncheckedNative(int startIndex, int endIndex)
native "OneByteString_substringUnchecked";
@@ -575,6 +586,10 @@
bool _isWhitespace(int codePoint) {
return _StringBase._isTwoByteWhitespace(codePoint);
}
+
+ bool operator ==(Object other) {
+ return super == other;
+ }
}
@@ -587,6 +602,10 @@
bool _isWhitespace(int codePoint) {
return _StringBase._isOneByteWhitespace(codePoint);
}
+
+ bool operator ==(Object other) {
+ return super == other;
+ }
}
@@ -599,6 +618,10 @@
bool _isWhitespace(int codePoint) {
return _StringBase._isTwoByteWhitespace(codePoint);
}
+
+ bool operator ==(Object other) {
+ return super == other;
+ }
}
« no previous file with comments | « no previous file | runtime/vm/intrinsifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698