From e5dca8228e6b60cac5957726700c66d0565c064e Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 3 Oct 2018 21:32:28 +0200 Subject: Import: remove dive->downloaded logic Dive importing is now performed via a distinct table which is merged into the main dive table. Thus, it is known which of the dive is new and which is old. This information can now be implicitely encoded in the parameter-position of merge_dive() [i.e. pass old as first and new as second dive]. This makes marking of downloaded dives via a flag unnecessary. Signed-off-by: Berthold Stoeger --- core/divelist.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'core/divelist.c') diff --git a/core/divelist.c b/core/divelist.c index 41ebc4364..71556101c 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -1367,9 +1367,6 @@ void process_imported_dives(struct dive_table *import_table, bool prefer_importe sort_table(import_table); merge_imported_dives(import_table); - for (i = 0; i < import_table->nr; i++) - import_table->dives[i]->downloaded = true; - /* Merge newly imported dives into the dive table. * Since both lists (old and new) are sorted, we can step * through them concurrently and locate the insertions points. @@ -1416,10 +1413,6 @@ void process_imported_dives(struct dive_table *import_table, bool prefer_importe for ( ; i < import_table->nr; i++) add_single_dive(dive_table.nr, import_table->dives[i]); - /* make sure no dives are still marked as downloaded */ - for (i = 0; i < dive_table.nr; i++) - dive_table.dives[i]->downloaded = false; - /* we took care of all dives, clean up the import table */ import_table->nr = 0; -- cgit v1.2.3-70-g09d2