summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2017-09-10 11:39:25 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-09-11 07:19:57 -0700
commit5b5cab2905aea4d97e3c6d6aa13455d63faf975c (patch)
tree37ceed5a4b302ee65a176b168bbd87f3e049e011 /core
parent25fc72e22ff4104d08f2f7c5acc252a84ebfcc40 (diff)
downloadsubsurface-5b5cab2905aea4d97e3c6d6aa13455d63faf975c.tar.gz
Do not merge dives with zero duration
As these are probably manually entered dives with incomplete data, it is better not to merge them. See #561 Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/dive.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/dive.c b/core/dive.c
index 7f89e5063..0b0cbd671 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -2645,6 +2645,7 @@ static int likely_same_dive(struct dive *a, struct dive *b)
*/
if (!similar(a->maxdepth.mm, b->maxdepth.mm, 1000) ||
(a->meandepth.mm && b->meandepth.mm && !similar(a->meandepth.mm, b->meandepth.mm, 1000)) ||
+ !a->duration.seconds || !b->duration.seconds ||
!similar(a->duration.seconds, b->duration.seconds, 5 * 60))
return 0;