From bf1f66ee69ce76f3bc6c23af7d780f595add149a Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Mon, 21 Apr 2014 13:55:38 +0200 Subject: work on #3780: do not reload caches to get their attributes The attributes are lazily loaded, so they will always be up-to-date. --- main/src/cgeo/geocaching/filter/AttributeFilter.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'main/src') diff --git a/main/src/cgeo/geocaching/filter/AttributeFilter.java b/main/src/cgeo/geocaching/filter/AttributeFilter.java index 6f0d5da..552a48c 100644 --- a/main/src/cgeo/geocaching/filter/AttributeFilter.java +++ b/main/src/cgeo/geocaching/filter/AttributeFilter.java @@ -1,14 +1,11 @@ package cgeo.geocaching.filter; import cgeo.geocaching.CgeoApplication; -import cgeo.geocaching.DataStore; import cgeo.geocaching.Geocache; import cgeo.geocaching.R; -import cgeo.geocaching.enumerations.LoadFlags.LoadFlag; import android.content.res.Resources; -import java.util.EnumSet; import java.util.LinkedList; import java.util.List; @@ -29,11 +26,7 @@ class AttributeFilter extends AbstractFilter { @Override public boolean accepts(final Geocache cache) { - Geocache fullCache = DataStore.loadCache(cache.getGeocode(), EnumSet.of(LoadFlag.LOAD_ATTRIBUTES)); - if (fullCache == null) { - fullCache = cache; - } - return fullCache.getAttributes().contains(attribute); + return cache.getAttributes().contains(attribute); } public static class Factory implements IFilterFactory { -- cgit v1.1