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

Unified Diff: pkg/analyzer/lib/src/task/model.dart

Issue 1152063004: Use artificial hashCode values. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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: pkg/analyzer/lib/src/task/model.dart
diff --git a/pkg/analyzer/lib/src/task/model.dart b/pkg/analyzer/lib/src/task/model.dart
index a48f85a983b84d1a74bdcb9394549ee58a013353..9ef568e5c1ef7cba89d9da8ef68e8d14ba3f74cf 100644
--- a/pkg/analyzer/lib/src/task/model.dart
+++ b/pkg/analyzer/lib/src/task/model.dart
@@ -37,6 +37,11 @@ class ListResultDescriptorImpl<E> extends ResultDescriptorImpl<List<E>>
* A concrete implementation of a [ResultDescriptor].
*/
class ResultDescriptorImpl<V> implements ResultDescriptor<V> {
+ static int _NEXT_HASH = 0;
+
+ @override
+ final hashCode = _NEXT_HASH++;
+
/**
* The name of the result, used for debugging.
*/
@@ -61,6 +66,11 @@ class ResultDescriptorImpl<V> implements ResultDescriptor<V> {
{this.cachingPolicy: DEFAULT_CACHING_POLICY});
@override
+ bool operator ==(Object other) {
+ return other is ResultDescriptorImpl && other.hashCode == hashCode;
+ }
+
+ @override
TaskInput<V> of(AnalysisTarget target) =>
new SimpleTaskInput<V>(target, this);

Powered by Google App Engine
This is Rietveld 408576698