From 8ef2b129d9f01487ab35a99537817ab1bdbf9db6 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Wed, 1 Jan 2014 16:25:34 +0100 Subject: 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. --- main/src/cgeo/geocaching/Geocache.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'main') 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 -- cgit v1.1