optimization

This commit is contained in:
Alexey Kudravtsev
2011-03-31 14:57:27 +04:00
parent d6ac5f1dd3
commit 7c5222eaf6
@@ -84,13 +84,15 @@ class AnchorElementInfo extends SelfElementInfo {
@Override
public void fastenBelt(int offset) {
PsiElement element = restoreElement();
if (element != null) {
// switch to tree
stubId = -1;
myStubElementType = null;
PsiElement anchor = AnchorElementInfoFactory.getAnchor(element);
setRange((anchor == null ? element : anchor).getTextRange());
if (stubId != -1) {
PsiElement element = restoreElement();
if (element != null) {
// switch to tree
stubId = -1;
myStubElementType = null;
PsiElement anchor = AnchorElementInfoFactory.getAnchor(element);
setRange((anchor == null ? element : anchor).getTextRange());
}
}
super.fastenBelt(offset);
}