mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use ContainerUtil.process
This commit is contained in:
+4
-8
@@ -297,14 +297,10 @@ public class JavaDirectInheritorsSearcher implements QueryExecutor<PsiClass, Dir
|
||||
if (!acceptAnonymous) {
|
||||
classStream = classStream.filter(c -> !(c instanceof PsiAnonymousClass));
|
||||
}
|
||||
|
||||
Iterator<PsiClass> it = classStream.iterator();
|
||||
while (it.hasNext()) {
|
||||
return ContainerUtil.process(classStream.iterator(), c -> {
|
||||
ProgressManager.checkCanceled();
|
||||
PsiClass next = it.next();
|
||||
if (checkInheritance && ReadAction.compute(() -> !next.isInheritor(baseClass, false))) continue;
|
||||
if (!consumer.process(next)) return false;
|
||||
}
|
||||
return true;
|
||||
if (checkInheritance && ReadAction.compute(() -> !c.isInheritor(baseClass, false))) return true;
|
||||
return consumer.process(c);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+1
-7
@@ -362,13 +362,7 @@ public class JavaFunctionalExpressionSearcher extends QueryExecutorBase<PsiFunct
|
||||
@NotNull SamDescriptor descriptor,
|
||||
@NotNull Processor<PsiFunctionalExpression> consumer) {
|
||||
if (funExprInfo != null) {
|
||||
Iterator<PsiFunctionalExpression> it = funExprInfo.getHierarchyChildren().iterator();
|
||||
while (it.hasNext()) {
|
||||
PsiFunctionalExpression next = it.next();
|
||||
if (!consumer.process(next)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!ContainerUtil.process(funExprInfo.getHierarchyChildren().iterator(), consumer)) return false;
|
||||
GlobalSearchScope dirtyScope = funExprInfo.getDirtyScope();
|
||||
descriptor.effectiveUseScope = descriptor.effectiveUseScope.intersectWith(dirtyScope);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user