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

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: 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
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]) {
Johnni Winther 2013/06/23 19:07:42 Wouldn't it be faster to have functions [computeHa
kasperl 2013/06/24 06:32:43 At some point we should probably figure out if usi
+ return (part1.hashCode
+ ^ part2.hashCode
+ ^ part3.hashCode
+ ^ part4.hashCode) & 0x3fffffff;
+}
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698