mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
6d0af91398
commit
4679f4fbbc
3 changed files with 8 additions and 11 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue