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

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 1677213003: Compute ElementImpl.hashCode using location. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « pkg/analysis_server/test/services/completion/dart/optype_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/element.dart
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 1ff1de5dbac1ee51b0ab8bf2cb6ea86bb5d050ef..74c0bbaa1730ad5da1a31d8e7645435dd325ab63 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -1801,13 +1801,7 @@ abstract class ElementImpl implements Element {
// TODO: We might want to re-visit this optimization in the future.
// We cache the hash code value as this is a very frequently called method.
if (_cachedHashCode == null) {
- int hashIdentifier = identifier.hashCode;
- Element enclosing = enclosingElement;
- if (enclosing != null) {
- _cachedHashCode = hashIdentifier + enclosing.hashCode;
- } else {
- _cachedHashCode = hashIdentifier;
- }
+ _cachedHashCode = location.hashCode;
}
return _cachedHashCode;
}
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/optype_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698