From 6f8916e58c00da21032515979eaba9812625474e Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sat, 28 May 2016 13:17:51 +0200 Subject: [PATCH] Feed item filter: Load queue ids only once --- .../java/de/danoeh/antennapod/core/feed/FeedItemFilter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java index fdde4b34c..9d8f4adf8 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java @@ -6,6 +6,7 @@ import java.util.ArrayList; import java.util.List; import de.danoeh.antennapod.core.storage.DBReader; +import de.danoeh.antennapod.core.util.LongList; public class FeedItemFilter { private final String[] mProperties; @@ -66,13 +67,14 @@ public class FeedItemFilter { if (showQueued && showNotQueued) return result; if (showDownloaded && showNotDownloaded) return result; + final LongList queuedIds = DBReader.getQueueIDList(); for(FeedItem item : items) { // If the item does not meet a requirement, skip it. if (showPlayed && !item.isPlayed()) continue; if (showUnplayed && item.isPlayed()) continue; if (showPaused && item.getState() != FeedItem.State.IN_PROGRESS) continue; - boolean queued = DBReader.getQueueIDList().contains(item.getId()); + boolean queued = queuedIds.contains(item.getId()); if (showQueued && !queued) continue; if (showNotQueued && queued) continue;