aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/LogEntry.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-05-07 12:33:24 +0200
committerSamuel Tardieu <sam@rfc1149.net>2012-05-07 14:42:43 +0200
commitce7040be4bc2584f4d4a23c82148eac73c66039f (patch)
tree4e099d8fc37baaeae704aefdbc598f12c764f33c /main/src/cgeo/geocaching/LogEntry.java
parent5300c874af30dc3e1d4322b2841a22d180410014 (diff)
downloadcgeo-ce7040be4bc2584f4d4a23c82148eac73c66039f.zip
cgeo-ce7040be4bc2584f4d4a23c82148eac73c66039f.tar.gz
cgeo-ce7040be4bc2584f4d4a23c82148eac73c66039f.tar.bz2
Refactoring: Collections.emptyList() is cheap and needs no caching
Diffstat (limited to 'main/src/cgeo/geocaching/LogEntry.java')
-rw-r--r--main/src/cgeo/geocaching/LogEntry.java7
1 files changed, 1 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/LogEntry.java b/main/src/cgeo/geocaching/LogEntry.java
index e0e2e13..ceec732 100644
--- a/main/src/cgeo/geocaching/LogEntry.java
+++ b/main/src/cgeo/geocaching/LogEntry.java
@@ -11,11 +11,6 @@ import java.util.Collections;
import java.util.List;
public final class LogEntry {
- /**
- * avoid creating new empty lists all the time using this constant. We could also return Collections.EMPTY_LIST
- * using a cast, but that might trigger static code analysis tools.
- */
- private static final List<cgImage> EMPTY_LIST = Collections.emptyList();
public int id = 0;
public LogType type = LogType.NOTE; // note
@@ -76,7 +71,7 @@ public final class LogEntry {
*/
public List<cgImage> getLogImages() {
if (logImages == null) {
- return EMPTY_LIST;
+ return Collections.emptyList();
}
return logImages;
}