Cleanup: replace is_dive_site_used() by is_dive_site_selected()

is_dive_site_used() had a "selected" parameter. If true it would
return whether the given dive site had a selected dive. Turns
out all callers had this parameter set to true. Therefore, replace
by a simplified function without the "selected" parameter and
give the function an appropriate name.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-09-21 13:41:45 +02:00 committed by Dirk Hohndel
parent e46e018e21
commit 9c48130d37
3 changed files with 4 additions and 7 deletions

View file

@ -191,13 +191,10 @@ int nr_of_dives_at_dive_site(struct dive_site *ds)
return ds->dives.nr;
}
bool is_dive_site_used(struct dive_site *ds, bool select_only)
bool is_dive_site_selected(struct dive_site *ds)
{
int i;
if (!select_only)
return ds->dives.nr > 0;
for (i = 0; i < ds->dives.nr; i++) {
if (ds->dives.dives[i]->selected)
return true;