Checks reordered for better performance
This commit is contained in:
@@ -3,7 +3,6 @@ package org.jetbrains.jet.plugin.structureView;
|
||||
import com.intellij.ide.structureView.StructureViewTreeElement;
|
||||
import com.intellij.ide.util.treeView.smartTree.TreeElement;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.NavigatablePsiElement;
|
||||
@@ -70,10 +69,10 @@ public class JetStructureViewElement implements StructureViewTreeElement {
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextAttributesKey getTextAttributesKey() {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
// @Override
|
||||
// public TextAttributesKey getTextAttributesKey() {
|
||||
// return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
// }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -81,20 +81,20 @@ public abstract class TypeInfo<T> implements JetObject {
|
||||
}
|
||||
|
||||
public final boolean isInstance(Object obj) {
|
||||
if (obj == null) return nullable;
|
||||
|
||||
if (obj instanceof JetObject) {
|
||||
return ((JetObject) obj).getTypeInfo().isSubtypeOf(this);
|
||||
}
|
||||
if (obj == null)
|
||||
return nullable;
|
||||
|
||||
return theClass.isAssignableFrom(obj.getClass()); // TODO
|
||||
}
|
||||
|
||||
public final boolean isSubtypeOf(TypeInfo<?> superType) {
|
||||
if (!superType.theClass.isAssignableFrom(theClass)) {
|
||||
if (nullable && !superType.nullable) {
|
||||
return false;
|
||||
}
|
||||
if (nullable && !superType.nullable) {
|
||||
if (!superType.theClass.isAssignableFrom(theClass)) {
|
||||
return false;
|
||||
}
|
||||
if (projections != null) {
|
||||
|
||||
Reference in New Issue
Block a user