From 517fb7a462c207e32cc7c5ed50e1e9b1f359dbd8 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 24 Nov 2018 12:31:35 +0100 Subject: Core: keep trips in table(s) Currently, all trips are kept in a linked list. Replace the list by a table in analogy to dive_table. Use this to keep the trip_table sorted as suggested by dump_trip_list(). When inserting a trip into the table do that after adding the dives, to avoid warnings coming out of dump_trip_list(). Signed-off-by: Berthold Stoeger --- core/save-git.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/save-git.c') diff --git a/core/save-git.c b/core/save-git.c index cdc0ca980..33c01ab83 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -930,8 +930,8 @@ static int create_git_tree(git_repository *repo, struct dir *root, bool select_o save_divesites(repo, root); - for (trip = dive_trip_list; trip != NULL; trip = trip->next) - trip->saved = 0; + for (i = 0; i < trip_table.nr; ++i) + trip_table.trips[i]->saved = 0; /* save the dives */ git_storage_update_progress(translate("gettextFromC", "Start saving dives")); -- cgit v1.2.3-70-g09d2