mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Planner: don't do unnecessary work on empty dive plans
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b791b41db9
commit
65f3135a92
3 changed files with 18 additions and 1 deletions
14
planner.c
14
planner.c
|
@ -49,6 +49,20 @@ void dump_plan(struct diveplan *diveplan)
|
|||
}
|
||||
#endif
|
||||
|
||||
bool diveplan_empty(struct diveplan *diveplan)
|
||||
{
|
||||
struct divedatapoint *dp;
|
||||
if (!diveplan || !diveplan->dp)
|
||||
return true;
|
||||
dp = diveplan->dp;
|
||||
while(dp) {
|
||||
if (dp->time)
|
||||
return false;
|
||||
dp = dp->next;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void set_last_stop(bool last_stop_6m)
|
||||
{
|
||||
if (last_stop_6m == true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue