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>
This commit is contained in:
Berthold Stoeger 2021-01-11 11:21:31 +01:00 committed by Dirk Hohndel
parent 32ec9a8726
commit cd32c280ae

View file

@ -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;