From 2e00c7a146e7718420be288e2073cc144d054f4f Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Sun, 18 Nov 2012 09:54:03 +0100 Subject: refactoring: lazy initialized lists * change more users to only take Iterable interface * return unmodifiable list only --- main/src/cgeo/geocaching/export/GpxExport.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'main/src/cgeo/geocaching/export/GpxExport.java') diff --git a/main/src/cgeo/geocaching/export/GpxExport.java b/main/src/cgeo/geocaching/export/GpxExport.java index c06f0c6..7573db9 100644 --- a/main/src/cgeo/geocaching/export/GpxExport.java +++ b/main/src/cgeo/geocaching/export/GpxExport.java @@ -352,13 +352,12 @@ class GpxExport extends AbstractExport { } private void writeLogs(final cgCache cache) throws IOException { - final List logs = cache.getLogs(); - if (logs.size() <= 0) { + if (cache.getLogs().isEmpty()) { return; } gpx.write(""); - for (LogEntry log : logs) { + for (LogEntry log : cache.getLogs()) { gpx.write(""); @@ -386,7 +385,7 @@ class GpxExport extends AbstractExport { } private void writeAttributes(final cgCache cache) throws IOException { - if (!cache.hasAttributes()) { + if (cache.getAttributes().isEmpty()) { return; } //TODO: Attribute conversion required: English verbose name, gpx-id -- cgit v1.1