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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/util/util.dart

Issue 17569004: Implement hashCode on objects stored in a set or used as map keys. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased on CL 17588005. Created 7 years, 6 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
Index: dart/sdk/lib/_internal/compiler/implementation/util/util.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/util/util.dart b/dart/sdk/lib/_internal/compiler/implementation/util/util.dart
index c9c0e6657dd90ffc915bbe9a30d59d1f97ba3f6f..3456dbf4bd337772accee22f3105e05b5224080d 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/util/util.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/util/util.dart
@@ -108,3 +108,10 @@ void writeJsonEscapedCharsOn(String string, buffer) {
}
buffer.write(string);
}
+
+int computeHashCode(part1, [part2, part3, part4]) {
+ return (part1.hashCode
+ ^ part2.hashCode
+ ^ part3.hashCode
+ ^ part4.hashCode) & 0x3fffffff;
+}

Powered by Google App Engine
This is Rietveld 408576698