core: move get_same_dive_site() into dive_site_table class

This was the only dive_site_table function that accessed
to global divelog, which is odd. Make it consistent with
the others.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-11 18:41:49 +02:00 committed by bstoeger
parent 4ac2486a23
commit 512eada468
4 changed files with 7 additions and 10 deletions

View file

@ -1130,7 +1130,7 @@ void process_imported_dives(struct divelog *import_log, int flags,
/* If dive sites already exist, use the existing versions. */
for (auto &new_ds: *import_log->sites) {
struct dive_site *old_ds = get_same_dive_site(*new_ds);
struct dive_site *old_ds = divelog.sites->get_same(*new_ds);
/* Check if it dive site is actually used by new dives. */
for (j = 0; j < import_log->dives->nr; j++) {