mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Helper function to determined planned dives
... to reduce code duplication. Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
f1fc89b978
commit
c349692d98
4 changed files with 8 additions and 3 deletions
|
|
@ -3357,6 +3357,10 @@ void dump_taglist(const char *intro, struct tag_entry *tl)
|
|||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
bool is_dc_planner(const struct divecomputer *dc) {
|
||||
return same_string(dc->model, "planned dive");
|
||||
}
|
||||
|
||||
/*
|
||||
* Merging two dives can be subtle, because there's two different ways
|
||||
* of merging:
|
||||
|
|
@ -3401,7 +3405,7 @@ struct dive *merge_dives(const struct dive *a, const struct dive *b, int offset,
|
|||
offset = 0;
|
||||
}
|
||||
|
||||
if (same_string(a->dc.model, "planned dive")) {
|
||||
if (is_dc_planner(&a->dc)) {
|
||||
const struct dive *tmp = a;
|
||||
a = b;
|
||||
b = tmp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue