diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2012-11-18 09:54:03 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2012-11-18 09:54:03 +0100 |
| commit | 2e00c7a146e7718420be288e2073cc144d054f4f (patch) | |
| tree | 5d32af3fb31a6d133f7a5f4b81792368248b7b39 /main/src/cgeo/geocaching/export/GpxExport.java | |
| parent | 1acd103d9c4a4104aa54ed3c2f693f80ba12a8a6 (diff) | |
| download | cgeo-2e00c7a146e7718420be288e2073cc144d054f4f.zip cgeo-2e00c7a146e7718420be288e2073cc144d054f4f.tar.gz cgeo-2e00c7a146e7718420be288e2073cc144d054f4f.tar.bz2 | |
refactoring: lazy initialized lists
* change more users to only take Iterable interface
* return unmodifiable list only
Diffstat (limited to 'main/src/cgeo/geocaching/export/GpxExport.java')
| -rw-r--r-- | main/src/cgeo/geocaching/export/GpxExport.java | 7 |
1 files changed, 3 insertions, 4 deletions
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<LogEntry> logs = cache.getLogs(); - if (logs.size() <= 0) { + if (cache.getLogs().isEmpty()) { return; } gpx.write("<groundspeak:logs>"); - for (LogEntry log : logs) { + for (LogEntry log : cache.getLogs()) { gpx.write("<groundspeak:log id=\""); gpx.write(Integer.toString(log.id)); 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 |
