summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-11 11:21:31 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-11 08:42:17 -0800
commitcd32c280ae063e143faebf9c5cf497e6dce3abb7 (patch)
treee07a6084152a81f7f0356064c9215a8e06dd10d1 /core
parent32ec9a8726ae6d12a742132a3d3140b6f6b0b4cc (diff)
downloadsubsurface-cd32c280ae063e143faebf9c5cf497e6dce3abb7.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r--core/dive.c1
1 files changed, 0 insertions, 1 deletions
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;