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

Unified Diff: sdk/lib/uri/uri.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « sdk/lib/svg/dartium/svg_dartium.dart ('k') | sdk/lib/utf/utf16.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/uri/uri.dart
diff --git a/sdk/lib/uri/uri.dart b/sdk/lib/uri/uri.dart
index 4933d9d625b2f165882d795bdd3c1e272c3fd07d..6b01a0638c58de7b883d2d7c940b1019e49af44a 100644
--- a/sdk/lib/uri/uri.dart
+++ b/sdk/lib/uri/uri.dart
@@ -229,6 +229,27 @@ class Uri {
return sb.toString();
}
+ bool operator==(other) {
+ if (other is! Uri) return false;
+ Uri uri = other;
+ return scheme == uri.scheme &&
+ userInfo == uri.userInfo &&
+ domain == uri.domain &&
+ port == uri.port &&
+ path == uri.path &&
+ query == uri.query &&
+ fragment == uri.fragment;
+ }
+
+ int get hashCode {
+ int combine(part, current) {
+ // The sum is truncated to 30 bits to make sure it fits into a Smi.
+ return (current * 31 + part.hashCode) & 0x3FFFFFFF;
+ }
+ return combine(scheme, combine(userInfo, combine(domain, combine(port,
+ combine(path, combine(query, combine(fragment, 1)))))));
+ }
+
static void _addIfNonEmpty(StringBuffer sb, String test,
String first, String second) {
if ("" != test) {
« no previous file with comments | « sdk/lib/svg/dartium/svg_dartium.dart ('k') | sdk/lib/utf/utf16.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698