summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-30 15:40:13 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-30 15:40:13 -0700
commit65f3135a92cb9bb33c9870105334ca458e1f151d (patch)
tree033889895ff6b40989e1070fdc59d5e9ec231aa5 /planner.c
parentb791b41db98ddec7b25448092fa30f24224af8c5 (diff)
downloadsubsurface-65f3135a92cb9bb33c9870105334ca458e1f151d.tar.gz
Planner: don't do unnecessary work on empty dive plans
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/planner.c b/planner.c
index 2cc47258c..405b07e02 100644
--- a/planner.c
+++ b/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)