summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-09-05 13:54:22 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-09-05 13:54:22 -0700
commit4679f4fbbc1f303b963b4eabebbbc9c684299619 (patch)
tree70376feaa89fdf4470c5ffadd5ccc5580d3ad88e /parse-xml.c
parent6d0af91398b9ccd1cc29f087a9b695d0ffdf92fe (diff)
downloadsubsurface-4679f4fbbc1f303b963b4eabebbbc9c684299619.tar.gz
Avoid duplicate dive_trip entries
When inserting a trip into the dive_trip_list we already check for duplicate trips, but we still kept the additional dive_trip around. With this change we instead replace it with the existing one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 1569c8c5c..a1eb21070 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -39,11 +39,6 @@ void record_dive(struct dive *dive)
dive_table.nr = nr+1;
}
-void record_trip(struct dive *trip)
-{
- insert_trip(trip);
-}
-
static void delete_dive_renumber(struct dive **dives, int i, int nr)
{
struct dive *dive = dives[i];
@@ -1213,7 +1208,7 @@ static void trip_end(void)
{
if (!cur_trip)
return;
- record_trip(cur_trip);
+ insert_trip(&cur_trip);
cur_trip = NULL;
}