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

Unified Diff: pkg/compiler/lib/src/dart_types.dart

Issue 1861563002: Avoid Object.hashCode on a few objects (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « pkg/compiler/lib/src/closure.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dart_types.dart
diff --git a/pkg/compiler/lib/src/dart_types.dart b/pkg/compiler/lib/src/dart_types.dart
index 8df9c18c1b107b09c162878e219188e5b3720bd7..52621387adf97e00dfe993db4103cdecc56fe05d 100644
--- a/pkg/compiler/lib/src/dart_types.dart
+++ b/pkg/compiler/lib/src/dart_types.dart
@@ -445,6 +445,8 @@ abstract class GenericType extends DartType {
}
class InterfaceType extends GenericType {
+ int _hashCode;
+
InterfaceType(ClassElement element,
[List<DartType> typeArguments = const <DartType>[]])
: super(element, typeArguments) {
@@ -503,7 +505,7 @@ class InterfaceType extends GenericType {
return member;
}
- int get hashCode => super.hashCode;
+ int get hashCode => _hashCode ??= super.hashCode;
InterfaceType asRaw() => super.asRaw();
@@ -825,6 +827,8 @@ class DynamicType extends DartType {
return visitor.visitDynamicType(this, argument);
}
+ int get hashCode => 91;
+
String toString() => name;
}
« no previous file with comments | « pkg/compiler/lib/src/closure.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698