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

Unified Diff: pkg/analysis_server/lib/src/services/index/index.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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/index/index.dart
diff --git a/pkg/analysis_server/lib/src/services/index/index.dart b/pkg/analysis_server/lib/src/services/index/index.dart
index e80a190e3281821f7d11e976e7fe733c8baacc39..cea7395cd6fea61badcdcba65c018e937cccd6f9 100644
--- a/pkg/analysis_server/lib/src/services/index/index.dart
+++ b/pkg/analysis_server/lib/src/services/index/index.dart
@@ -320,6 +320,16 @@ class Relationship {
static Map<String, Relationship> _RELATIONSHIP_MAP = {};
/**
+ * The next artificial hash code.
+ */
+ static int _NEXT_HASH_CODE = 0;
+
+ /**
+ * The artifitial hash code for this object.
+ */
+ final int _hashCode = _NEXT_HASH_CODE++;
kasperl 2015/02/18 08:04:16 Have you considered masking here? If you start ove
scheglov 2015/02/18 17:20:32 Good question. See https://codereview.chromium.org
+
+ /**
* The unique identifier for this relationship.
*/
final String identifier;
@@ -330,6 +340,9 @@ class Relationship {
Relationship(this.identifier);
@override
+ int get hashCode => _hashCode;
+
+ @override
String toString() => identifier;
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698