cleanup: remove unused function get_dive_n_near()

The last caller was removed in 7eb422d988.
Since this is the only caller of dive_within_time_range(), remove that
function as well.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-05-22 22:11:49 +02:00 committed by Dirk Hohndel
parent 8f80129bac
commit 9365061e27
2 changed files with 0 additions and 24 deletions

View file

@ -3401,28 +3401,6 @@ bool time_during_dive_with_offset(struct dive *dive, timestamp_t when, timestamp
return start - offset <= when && when <= end + offset;
}
bool dive_within_time_range(struct dive *dive, timestamp_t when, timestamp_t offset)
{
timestamp_t start = dive->when;
timestamp_t end = dive_endtime(dive);
return when - offset <= start && end <= when + offset;
}
/* find the n-th dive that is part of a group of dives within the offset around 'when'.
* How is that for a vague definition of what this function should do... */
struct dive *find_dive_n_near(timestamp_t when, int n, timestamp_t offset)
{
int i, j = 0;
struct dive *dive;
for_each_dive (i, dive) {
if (dive_within_time_range(dive, when, offset))
if (++j == n)
return dive;
}
return NULL;
}
timestamp_t get_times()
{
int i;

View file

@ -272,9 +272,7 @@ extern bool dive_site_has_gps_location(const struct dive_site *ds);
extern int dive_has_gps_location(const struct dive *dive);
extern location_t dive_get_gps_location(const struct dive *d);
extern bool dive_within_time_range(struct dive *dive, timestamp_t when, timestamp_t offset);
extern bool time_during_dive_with_offset(struct dive *dive, timestamp_t when, timestamp_t offset);
struct dive *find_dive_n_near(timestamp_t when, int n, timestamp_t offset);
/* Check if two dive computer entries are the exact same dive (-1=no/0=maybe/1=yes) */
extern int match_one_dc(const struct divecomputer *a, const struct divecomputer *b);