diff --git a/F-Droid/src/org/fdroid/fdroid/Utils.java b/F-Droid/src/org/fdroid/fdroid/Utils.java index e69630a5b..a50657da1 100644 --- a/F-Droid/src/org/fdroid/fdroid/Utils.java +++ b/F-Droid/src/org/fdroid/fdroid/Utils.java @@ -662,14 +662,11 @@ public final class Utils { } for (File f : files) { - if (startsWith != null && f.getName().startsWith(startsWith)) { - continue; - } - if (endsWith != null && f.getName().endsWith(endsWith)) { - continue; - } - if (!f.delete()) { - Log.w(TAG, "Couldn't delete cache file " + f); + if ((startsWith != null && f.getName().startsWith(startsWith)) + || (endsWith != null && f.getName().endsWith(endsWith))) { + if (!f.delete()) { + Log.w(TAG, "Couldn't delete cache file " + f); + } } } }