core: move invalidate_dive_cache() to struct dive

Seems natural in a C++ code base.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-25 14:04:01 +02:00 committed by bstoeger
parent 1b593dc56c
commit 72bb38601d
11 changed files with 42 additions and 44 deletions

View file

@ -730,8 +730,8 @@ struct dive *dive_table::register_dive(std::unique_ptr<dive> d)
// dives have been added, their status will be updated.
d->hidden_by_filter = true;
fulltext_register(d.get()); // Register the dive's fulltext cache
invalidate_dive_cache(d.get()); // Ensure that dive is written in git_save()
fulltext_register(d.get()); // Register the dive's fulltext cache
d->invalidate_cache(); // Ensure that dive is written in git_save()
auto [res, idx] = put(std::move(d));
return res;