mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 19:13:24 +00:00
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>
This commit is contained in:
parent
434644b381
commit
0935513636
1 changed files with 1 additions and 10 deletions
11
core/dive.c
11
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue