mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Looks like I've optimized some code, that we don't need at all. refElement.getPsiElement(), which is slow is only used to get it's file to check if it belongs to search scope.
This commit is contained in:
+5
-4
@@ -343,11 +343,12 @@ public class UnusedDeclarationInspection extends FilteringInspectionTool {
|
||||
final RefElementImpl refElement = (RefElementImpl)refEntity;
|
||||
if (!refElement.isSuspicious()) return;
|
||||
|
||||
final PsiElement element = refElement.getElement();
|
||||
if (element == null) return;
|
||||
PsiFile file = refElement.getContainingFile();
|
||||
|
||||
if (file == null) return;
|
||||
final boolean isSuppressed = refElement.isSuppressed(getShortName());
|
||||
if (!getContext().isToCheckMember(element, UnusedDeclarationInspection.this) || isSuppressed) {
|
||||
if (isSuppressed || !scope.contains(element)) {
|
||||
if (!getContext().isToCheckFile(file, UnusedDeclarationInspection.this) || isSuppressed) {
|
||||
if (isSuppressed || !scope.contains(file)) {
|
||||
getEntryPointsManager().addEntryPoint(refElement, false);
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user