mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
processFilesRecursively optimized by eliminating unnecessary 'isDirectory' calls (ZD-19763)
This commit is contained in:
@@ -1072,11 +1072,11 @@ public class FileUtil extends FileUtilRt {
|
||||
while (!queue.isEmpty()) {
|
||||
final File file = queue.removeFirst();
|
||||
if (!processor.process(file)) return false;
|
||||
if (file.isDirectory() && (directoryFilter == null || directoryFilter.process(file))) {
|
||||
final File[] children = file.listFiles();
|
||||
if (children != null) {
|
||||
ContainerUtil.addAll(queue, children);
|
||||
}
|
||||
if (directoryFilter != null && (!file.isDirectory() || !directoryFilter.process(file))) continue;
|
||||
|
||||
final File[] children = file.listFiles();
|
||||
if (children != null) {
|
||||
ContainerUtil.addAll(queue, children);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user