mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
parallelize unconditionally since the processing of each file can be expensive (IDEA-CR-47613)
GitOrigin-RevId: 7a1b344777e41c164175834b6a0341f0e074970a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9e838347a6
commit
a6d0b335f5
@@ -173,16 +173,11 @@ public class JavaFunctionalExpressionSearcher extends QueryExecutorBase<PsiFunct
|
||||
}
|
||||
return true;
|
||||
};
|
||||
if (!processConcurrentlyIfTooMany(filesFirst, vFileProcessor)) return;
|
||||
if (!JobLauncher.getInstance().invokeConcurrentlyUnderProgress(new ArrayList<>(filesFirst),
|
||||
ProgressIndicatorProvider.getGlobalProgressIndicator(), vFileProcessor)) return;
|
||||
allFiles.removeAll(filesFirst);
|
||||
processConcurrentlyIfTooMany(allFiles, vFileProcessor);
|
||||
}
|
||||
|
||||
private static boolean processConcurrentlyIfTooMany(@NotNull Set<? extends VirtualFile> files, @NotNull Processor<? super VirtualFile> processor) {
|
||||
if (files.size() < 100) {
|
||||
return ContainerUtil.process(files, processor);
|
||||
}
|
||||
return JobLauncher.getInstance().invokeConcurrentlyUnderProgress(new ArrayList<>(files), ProgressIndicatorProvider.getGlobalProgressIndicator(), processor);
|
||||
JobLauncher.getInstance().invokeConcurrentlyUnderProgress(new ArrayList<>(allFiles),
|
||||
ProgressIndicatorProvider.getGlobalProgressIndicator(), vFileProcessor);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user