From: Dirk Hohndel Date: Wed, 5 Oct 2011 03:33:17 +0000 (-0700) Subject: Make the dive merging code more tolerant X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0e29df87f43365309f89d6dbd5b4a3acd8ea5054;p=ext%2Fsubsurface.git Make the dive merging code more tolerant Depending on the tool used to import a dive from the uemis Zurich we end up with different time stamps for the dive - just by a few seconds, but the existing code insisted on an exact match. We now allow for up to 60 seconds in difference and still consider two dives as the same. Signed-off-by: Dirk Hohndel --- diff --git a/dive.c b/dive.c index 9af6449..deb72fc 100644 --- a/dive.c +++ b/dive.c @@ -410,7 +410,7 @@ struct dive *try_to_merge(struct dive *a, struct dive *b) int i; struct dive *res; - if (a->when != b->when) + if ((a->when >= b->when + 60) || (a->when <= b->when - 60)) return NULL; res = alloc_dive();