diff options
Diffstat (limited to 'main/src/cgeo/geocaching/cgData.java')
| -rw-r--r-- | main/src/cgeo/geocaching/cgData.java | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/main/src/cgeo/geocaching/cgData.java b/main/src/cgeo/geocaching/cgData.java index b015344..3f48b07 100644 --- a/main/src/cgeo/geocaching/cgData.java +++ b/main/src/cgeo/geocaching/cgData.java @@ -1801,14 +1801,8 @@ public class cgData { throw new IllegalArgumentException("geocode must not be empty"); } - Set<String> geocodes = new HashSet<String>(); - geocodes.add(geocode); - - Set<cgCache> caches = loadCaches(geocodes, loadFlags); - if (caches != null && caches.size() >= 1) { - return (cgCache) caches.toArray()[0]; - } - return null; + final Set<cgCache> caches = loadCaches(Collections.singleton(geocode), loadFlags); + return caches.isEmpty() ? null : caches.iterator().next(); } /** |
