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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.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
Index: dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart b/dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
index f74db6e01fb66911c5769bab55b85a189dd4f366..c8c06f5d5938f2694497dd3a4ef50de11ae89a73 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart
@@ -10,6 +10,8 @@ part of types;
class ElementTypeHolder {
// This field will be set after global analysis.
TypeMask elementType;
+
+ int get hashCode => elementType.hashCode;
}
/// A [ContainerTypeMask] is a [TypeMask] for a specific allocation
@@ -84,4 +86,8 @@ class ContainerTypeMask extends ForwardingTypeMask {
String toString() {
return 'Container mask: $elementType';
}
+
+ int get hashCode {
+ return computeHashCode(asFlat, allocationNode, allocationElement, holder);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698