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

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: Merged with TOT 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 94a0ce07d0e4cd95b5c0f9388071fde3abf68c7f..c9c8399134a5918df15bfa47901ab71f1917b0b7 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/util/util.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/util/util.dart
@@ -110,3 +110,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