From a87fe8b44d424f7aed9480ac04d53a045bc588c4 Mon Sep 17 00:00:00 2001 From: CalDescent Date: Sat, 4 Dec 2021 12:06:15 +0000 Subject: [PATCH] Combined path filtering into a single filter to avoid iterating through the list multiple times. --- .../controller/arbitrary/ArbitraryDataStorageManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/qortal/controller/arbitrary/ArbitraryDataStorageManager.java b/src/main/java/org/qortal/controller/arbitrary/ArbitraryDataStorageManager.java index fc35a2d8..de138b16 100644 --- a/src/main/java/org/qortal/controller/arbitrary/ArbitraryDataStorageManager.java +++ b/src/main/java/org/qortal/controller/arbitrary/ArbitraryDataStorageManager.java @@ -235,9 +235,9 @@ public class ArbitraryDataStorageManager extends Thread { // Also exclude the _temp and _misc paths if present List allPaths = Files.walk(dataPath, 3) .filter(Files::isDirectory) - .filter(path -> !path.toAbsolutePath().toString().contains(tempPath.toAbsolutePath().toString())) - .filter(path -> !path.toString().contains("_misc")) - .filter(path -> path.getFileName().toString().length() > 32) + .filter(path -> !path.toAbsolutePath().toString().contains(tempPath.toAbsolutePath().toString()) + && !path.toString().contains("_misc") + && path.getFileName().toString().length() > 32) .collect(Collectors.toList()); // Loop through each path and attempt to match it to a signature