diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2014-01-01 16:25:34 +0100 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2014-01-01 16:47:24 +0100 |
| commit | 8ef2b129d9f01487ab35a99537817ab1bdbf9db6 (patch) | |
| tree | 1c47230aea9ec1e4f0c19031466bbc2c8e7b1b5a /main/src | |
| parent | 9bed9f046731e71f4ef79502ceec46f9502b4de2 (diff) | |
| download | cgeo-8ef2b129d9f01487ab35a99537817ab1bdbf9db6.zip cgeo-8ef2b129d9f01487ab35a99537817ab1bdbf9db6.tar.gz cgeo-8ef2b129d9f01487ab35a99537817ab1bdbf9db6.tar.bz2 | |
optimization: do not merge a cache against itself
During the process of saving a cache, it will be merged against the
version present in CacheCache if any. Quite often, the version in
CacheCache is the cache object itself, and a merge is attempted against
itself.
Diffstat (limited to 'main/src')
| -rw-r--r-- | main/src/cgeo/geocaching/Geocache.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java index 6262792..d4114bd 100644 --- a/main/src/cgeo/geocaching/Geocache.java +++ b/main/src/cgeo/geocaching/Geocache.java @@ -198,6 +198,9 @@ public class Geocache implements ICache, IWaypoint { if (other == null) { return false; } + if (other == this) { + return true; + } updated = System.currentTimeMillis(); // if parsed cache is not yet detailed and stored is, the information of |
