Chromium Code Reviews| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/ElementImpl.java |
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/ElementImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/ElementImpl.java |
| index 5910023d67b2978ae2c15de57b7e06d826639ae4..8113ee98ebb287e0ac99495f757f851fe457912f 100644 |
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/ElementImpl.java |
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/ElementImpl.java |
| @@ -198,7 +198,13 @@ public 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 == 0) { |
| - cachedHashCode = getLocation().hashCode(); |
| + int hashIdentifier = getIdentifier().hashCode(); |
|
Brian Wilkerson
2014/03/21 14:04:14
ElementLocation goes to extra work to not include
scheglov
2014/03/21 16:41:10
1. Most ElementImpl use new implementation.
2. Lib
|
| + Element enclosing = getEnclosingElement(); |
| + if (enclosing != null) { |
| + cachedHashCode = hashIdentifier + enclosing.hashCode(); |
|
Brian Wilkerson
2014/03/21 14:04:14
ElementLocation used a more complex calculation fo
scheglov
2014/03/21 16:41:10
Done.
scheglov
2014/03/21 16:55:05
Actually I spoke too fast.
It costs about 100 ms o
|
| + } else { |
| + cachedHashCode = hashIdentifier; |
| + } |
| } |
| return cachedHashCode; |
| } |