cleanup: remove get_times() functions

The function
1) was misnamed: it determined the time of the first selcted dive.
2) had only one caller.
3) would crash if there was no selected dive.

Let's just fold the functionality into the caller. It's a one-liner
anyway.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-10-25 11:45:27 +01:00 committed by Dirk Hohndel
parent 464dd93fe8
commit 4aa571d5a0
3 changed files with 5 additions and 17 deletions

View file

@ -3311,18 +3311,6 @@ bool time_during_dive_with_offset(const struct dive *dive, timestamp_t when, tim
return start - offset <= when && when <= end + offset;
}
timestamp_t get_times()
{
int i;
struct dive *dive;
for_each_dive (i, dive) {
if (dive->selected)
break;
}
return dive->when;
}
/* this sets a usually unused copy of the preferences with the units
* that were active the last time the dive list was saved to git storage
* (this isn't used in XML files); storing the unit preferences in the