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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 934113002: Generate artificial hashCode for often used classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 32b9f69cbf8f3534f445cefbd765c88ad93ef869..5b43f575c5b5fd426831897ac44b2a0b00ab9bac 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -8664,6 +8664,16 @@ class DartEntry extends SourceEntry {
*/
class DataDescriptor<E> {
/**
+ * The next artificial hash code.
+ */
+ static int _NEXT_HASH_CODE = 0;
+
+ /**
+ * The artifitial hash code for this object.
+ */
+ final int _hashCode = _NEXT_HASH_CODE++;
+
+ /**
* The name of the descriptor, used for debugging purposes.
*/
final String _name;
@@ -8680,6 +8690,9 @@ class DataDescriptor<E> {
DataDescriptor(this._name, [this.defaultValue = null]);
@override
+ int get hashCode => _hashCode;
+
+ @override
String toString() => _name;
}

Powered by Google App Engine
This is Rietveld 408576698