Chromium Code Reviews| Index: runtime/lib/string_patch.dart |
| =================================================================== |
| --- runtime/lib/string_patch.dart (revision 29210) |
| +++ 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; |
|
regis
2013/10/24 23:00:05
Is this the same as calling ==(other) on super? Ju
srdjan
2013/10/25 00:13:17
Yes.
|
| + } |
| + |
| 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; |
| + } |
| } |