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>
This commit is contained in:
Miika Turkia 2017-09-10 11:39:25 +03:00 committed by Dirk Hohndel
parent 25fc72e22f
commit 5b5cab2905

View file

@ -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;