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
|
@ -777,6 +777,8 @@ void DivePlannerPointsModel::addDecoToModel()
|
|||
{
|
||||
struct divedatapoint *dp;
|
||||
|
||||
if (diveplan_empty(&diveplan))
|
||||
return;
|
||||
bool oldRecalc = plannerModel->setRecalc(false);
|
||||
plannerModel->removeDeco();
|
||||
|
||||
|
@ -832,7 +834,7 @@ void DivePlannerPointsModel::createTemporaryPlan()
|
|||
#if DEBUG_PLAN
|
||||
dump_plan(&diveplan);
|
||||
#endif
|
||||
if (plannerModel->recalcQ()) {
|
||||
if (plannerModel->recalcQ() && !diveplan_empty(&diveplan)) {
|
||||
plan(&diveplan, &cache, &tempDive, stagingDive, isPlanner());
|
||||
addDecoToModel();
|
||||
if (mode == ADD || mode == PLAN) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue