aboutsummaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-19 16:18:09 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-05-06 13:58:09 -0700
commit093551363602e723864467af0812f13f4525855f (patch)
treec081e1485ad87ba13978a555f1b0b0af9e440309 /core/dive.c
parent434644b381cb1dc8d2080b19a9725bfe2660a217 (diff)
downloadsubsurface-093551363602e723864467af0812f13f4525855f.tar.gz
core: remove new_picture_for_dive() function in dive.c
We can do the same with get_picture_idx(). Yes, it is a bit more unwieldy. However a full reimplementation seems not worth it. We could make this a one-liner helper function though. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/core/dive.c b/core/dive.c
index abfff2bc5..8ed9995b8 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -3498,15 +3498,6 @@ void set_git_prefs(const char *prefs)
git_prefs.pp_graphs.po2 = 1;
}
-static bool new_picture_for_dive(struct dive *d, const char *filename)
-{
- FOR_EACH_PICTURE (d) {
- if (same_string(picture->filename, filename))
- return false;
- }
- return true;
-}
-
/* Return distance of timestamp to time of dive. Result is always positive, 0 means during dive. */
static timestamp_t time_from_dive(const struct dive *d, timestamp_t timestamp)
{
@@ -3591,7 +3582,7 @@ void create_picture(const char *filename, int shift_time, bool match_all)
if (!dive)
return;
- if (!new_picture_for_dive(dive, filename))
+ if (get_picture_idx(&dive->pictures, filename) >= 0)
return;
if (!match_all && !dive_check_picture_time(dive, timestamp))
return;