diff --git a/source/net/filebot/ui/rename/FilesListTransferablePolicy.java b/source/net/filebot/ui/rename/FilesListTransferablePolicy.java index 5633a2c0..0d94b423 100644 --- a/source/net/filebot/ui/rename/FilesListTransferablePolicy.java +++ b/source/net/filebot/ui/rename/FilesListTransferablePolicy.java @@ -51,14 +51,16 @@ class FilesListTransferablePolicy extends BackgroundFileTransferablePolicy @Override protected void load(List files, TransferAction action) { + // use fast file to minimize system calls like length(), isDirectory(), isFile(), ... + files.replaceAll(FastFile::new); + // collect files recursively and eliminate duplicates Set sink = new LinkedHashSet(64, 4); // load files recursively by default load(files, action != TransferAction.LINK, sink); - // use fast file to minimize system calls like length(), isDirectory(), isFile(), ... and list files in human order - publish(sink.stream().map(FastFile::new).toArray(File[]::new)); + publish(sink.toArray(new File[0])); } private void load(List files, boolean recursive, Collection sink) {