summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/dive.c13
-rw-r--r--core/dive.h1
2 files changed, 1 insertions, 13 deletions
diff --git a/core/dive.c b/core/dive.c
index 2408ba57c..ae468cf1d 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -3535,17 +3535,6 @@ struct dive *make_first_dc(const struct dive *d, int dc_number)
return res;
}
-int count_divecomputers(const struct dive *d)
-{
- int ret = 1;
- struct divecomputer *dc = d->dc.next;
- while (dc) {
- ret++;
- dc = dc->next;
- }
- return ret;
-}
-
static void delete_divecomputer(struct dive *d, int num)
{
int i;
@@ -3574,7 +3563,7 @@ static void delete_divecomputer(struct dive *d, int num)
/* If this is the currently displayed dive, we might have to adjust
* the currently displayed dive computer. */
- if (d == current_dive && dc_number >= count_divecomputers(d))
+ if (d == current_dive && dc_number >= number_of_computers(d))
dc_number--;
invalidate_dive_cache(d);
}
diff --git a/core/dive.h b/core/dive.h
index 4f94dba6b..b29cf9857 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -248,7 +248,6 @@ extern struct divecomputer *get_dive_dc(struct dive *dive, int nr);
extern timestamp_t dive_endtime(const struct dive *dive);
extern struct dive *make_first_dc(const struct dive *d, int dc_number);
-extern int count_divecomputers(const struct dive *d);
extern struct dive *clone_delete_divecomputer(const struct dive *d, int dc_number);
void split_divecomputer(const struct dive *src, int num, struct dive **out1, struct dive **out2);