core: make find_next_visible_dive() member of dive_table

This function implicitely accessed the global divelog. To make
that explicit make it a member of dive_table, such that the
caller must access it via the global variable.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-18 20:57:10 +02:00 committed by bstoeger
parent 4afefb1b9b
commit e9a57ac5f5
4 changed files with 8 additions and 10 deletions

View file

@ -600,7 +600,7 @@ void DeleteDive::redoit()
dive *newCurrent = nullptr;
if (!divesToAdd.dives.empty()) {
timestamp_t when = divesToAdd.dives[0].dive->when;
newCurrent = find_next_visible_dive(when);
newCurrent = divelog.dives.find_next_visible_dive(when);
}
select_single_dive(newCurrent);
}