core: remove get_dive() function

This implicitly accessed the global divelog. Most of the users were
in the test/ folder anyway. Replace by explicit accesses to the
global divelog.dives.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-20 21:02:31 +02:00 committed by bstoeger
parent 176f544106
commit 3660241993
8 changed files with 45 additions and 78 deletions

View file

@ -2878,13 +2878,6 @@ depth_t gas_mnd(struct gasmix mix, depth_t end, const struct dive *dive, int rou
return rounded_depth;
}
struct dive *get_dive(int nr)
{
if (nr < 0 || static_cast<size_t>(nr) >= divelog.dives.size())
return nullptr;
return divelog.dives[nr].get();
}
struct dive_site *get_dive_site_for_dive(const struct dive *dive)
{
return dive->dive_site;