Do fast checks first

This commit is contained in:
Maxim Shafirov
2012-04-10 16:01:26 +04:00
parent c5eaa6d5ba
commit 5f02ff82e9
@@ -341,6 +341,8 @@ public class UnusedDeclarationInspection extends FilteringInspectionTool {
@Override public void visitElement(final RefEntity refEntity) {
if (refEntity instanceof RefJavaElement) {
final RefElementImpl refElement = (RefElementImpl)refEntity;
if (!refElement.isSuspicious()) return;
final PsiElement element = refElement.getElement();
if (element == null) return;
final boolean isSuppressed = refElement.isSuppressed(getShortName());
@@ -350,7 +352,6 @@ public class UnusedDeclarationInspection extends FilteringInspectionTool {
}
return;
}
if (!refElement.isSuspicious()) return;
refElement.accept(new RefJavaVisitor() {
@Override public void visitElement(final RefEntity elem) {
if (elem instanceof RefElement) {