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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/NamedTypeMemberImpl.java

Issue 11348017: Making save a little faster: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/NamedTypeMemberImpl.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/NamedTypeMemberImpl.java (revision 14360)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/NamedTypeMemberImpl.java (working copy)
@@ -15,6 +15,7 @@
import com.google.dart.tools.core.DartCore;
import com.google.dart.tools.core.internal.model.info.DeclarationElementInfo;
+import com.google.dart.tools.core.model.DartElement;
import com.google.dart.tools.core.model.DartModelException;
import com.google.dart.tools.core.model.DartModifiers;
@@ -41,7 +42,8 @@
}
@Override
- public String getElementName() {
+ // Note: final added for performance reasons.
+ public final String getElementName() {
return name;
}
@@ -60,7 +62,22 @@
return new DartModifiers(info.getModifiers());
}
+ /**
+ * Inlined from DartElementImpl.hashCode().
+ */
@Override
+ public int hashCode() {
+ DartElement parent = getParent();
+
+ if (parent == null) {
+ return super.hashCode();
+ } else {
+ // Inlined from Util.combineHashCodes()
+ return name.hashCode() * 17 + parent.hashCode();
+ }
+ }
+
+ @Override
public boolean isStatic() {
return getModifiers().isStatic();
}

Powered by Google App Engine
This is Rietveld 408576698