From cd32c280ae063e143faebf9c5cf497e6dce3abb7 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 11 Jan 2021 11:21:31 +0100 Subject: [PATCH] undo: remove invalidate_dive_cache() call from make_first_dc() The make_first_dc() function clones a dive with a certain dive computer moved to the front. This is used by the MoveDiveComputerToFront undo command. make_first_dc() calls invalidate_dive(). However, the undo command does that by itself on every undo/redo. Thus, remove the call in make_first_dc(). Aside from consistency, the goal is to move invalidate_dive() to command/* so that we can be more aggressive about the whole topic: Store only "const dive *" pointers and thus force any writing access to explicitly invalidate the dive cache. Signed-off-by: Berthold Stoeger --- core/dive.c | 1 - 1 file changed, 1 deletion(-) diff --git a/core/dive.c b/core/dive.c index 7e0a8a66d..8bc66a655 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3014,7 +3014,6 @@ struct dive *make_first_dc(const struct dive *d, int dc_number) /* make a new unique id, since we still can't handle two equal ids */ res->id = dive_getUniqID(); - invalidate_dive_cache(res); if (dc_number == 0) return res;