From 4ba06f256a8978a664c0800bc66c591ab332d45a Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 4 Feb 2016 10:05:29 +0000 Subject: [PATCH] fix unecessary double caching --- source/net/filebot/media/MediaDetection.java | 21 ++++++-------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/source/net/filebot/media/MediaDetection.java b/source/net/filebot/media/MediaDetection.java index dce7960d..6ee97deb 100644 --- a/source/net/filebot/media/MediaDetection.java +++ b/source/net/filebot/media/MediaDetection.java @@ -73,26 +73,17 @@ public class MediaDetection { public static final ReleaseInfo releaseInfo = new ReleaseInfo(); - private static FileFilter diskFolder; - private static FileFilter clutterFile; - public static FileFilter getDiskFolderFilter() { - if (diskFolder == null) { - diskFolder = releaseInfo.getDiskFolderFilter(); - } - return diskFolder; + return releaseInfo.getDiskFolderFilter(); } public static FileFilter getClutterFileFilter() { - if (clutterFile == null) { - try { - clutterFile = releaseInfo.getClutterFileFilter(); - } catch (IOException e) { - Logger.getLogger(MediaDetection.class.getClass().getName()).log(Level.SEVERE, "Unable to access clutter file filter: " + e.getMessage(), e); - return ((File f) -> false); - } + try { + return releaseInfo.getClutterFileFilter(); + } catch (IOException e) { + Logger.getLogger(MediaDetection.class.getClass().getName()).log(Level.SEVERE, "Unable to access clutter file filter: " + e.getMessage(), e); } - return clutterFile; + return ((File f) -> false); } public static boolean isDiskFolder(File folder) {