From afd6c663469d6a9ae16c36e35ce87019bdb2c41c Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 4 Jun 2019 18:05:30 +0200 Subject: Cleanup: remove unused function find_dive_including Last caller was removed in 7eb422d98837b3cfb289a66fa0f3a8f78f222001. Signed-off-by: Berthold Stoeger --- core/dive.c | 15 --------------- core/dive.h | 1 - 2 files changed, 16 deletions(-) (limited to 'core') diff --git a/core/dive.c b/core/dive.c index a54c3aa00..624aa8d00 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3351,21 +3351,6 @@ timestamp_t dive_endtime(const struct dive *dive) return dive->when + dive_totaltime(dive); } -struct dive *find_dive_including(timestamp_t when) -{ - int i; - struct dive *dive; - - /* binary search, anyone? Too lazy for now; - * also we always use the duration from the first divecomputer - * could this ever be a problem? */ - for_each_dive (i, dive) { - if (dive->when <= when && when <= dive_endtime(dive)) - return dive; - } - return NULL; -} - bool time_during_dive_with_offset(struct dive *dive, timestamp_t when, timestamp_t offset) { timestamp_t start = dive->when; diff --git a/core/dive.h b/core/dive.h index 042f825f4..e9bb926ae 100644 --- a/core/dive.h +++ b/core/dive.h @@ -292,7 +292,6 @@ extern location_t dive_get_gps_location(const struct dive *d); extern int report_error(const char *fmt, ...); extern void set_error_cb(void(*cb)(char *)); // Callback takes ownership of passed string -extern struct dive *find_dive_including(timestamp_t when); 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); -- cgit v1.2.3-70-g09d2