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

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

Issue 1805613002: Make ElementLocationImpl.hashCode SMI, improve performance. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | 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 15e75ebe6d220b0c1a1677a51e3a5804715ed151..24241df84beef19222e2b07cd8f24fed4508f8e5 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -2250,10 +2250,10 @@ class ElementLocationImpl implements ElementLocation {
@override
int get hashCode {
- int result = 1;
+ int result = 0;
for (int i = 0; i < _components.length; i++) {
String component = _components[i];
- result = 31 * result + component.hashCode;
+ result = JenkinsSmiHash.combine(result, component.hashCode);
}
return result;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698