From 74c8bd34a0d0184642401de75c62726d92a4cb4b Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 4 Sep 2024 19:20:45 +0200 Subject: [PATCH] planner: remove unnecessary clearing of dive plan I don't get the point of these calls to dp.clear(). The plan is overwritten immediately afterwards anyway. Signed-off-by: Berthold Stoeger --- qt-models/diveplannermodel.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 57d18211e..c309cc658 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -1270,7 +1270,6 @@ void DivePlannerPointsModel::computeVariations(std::unique_ptr if (my_instance != instanceCounter) return; plan(&ds, plan_copy, dive.get(), dcNr, 1, original, cache, true, false); - plan_copy.dp.clear(); save.restore(&ds, false); cloneDiveplan(*original_plan, plan_copy); @@ -1279,7 +1278,6 @@ void DivePlannerPointsModel::computeVariations(std::unique_ptr if (my_instance != instanceCounter) return; plan(&ds, plan_copy, dive.get(), dcNr, 1, deeper, cache, true, false); - plan_copy.dp.clear(); save.restore(&ds, false); second_to_last(plan_copy.dp).depth.mm -= delta_depth.mm; @@ -1287,7 +1285,6 @@ void DivePlannerPointsModel::computeVariations(std::unique_ptr if (my_instance != instanceCounter) return; plan(&ds, plan_copy, dive.get(), dcNr, 1, shallower, cache, true, false); - plan_copy.dp.clear(); save.restore(&ds, false); cloneDiveplan(*original_plan, plan_copy); @@ -1295,14 +1292,12 @@ void DivePlannerPointsModel::computeVariations(std::unique_ptr if (my_instance != instanceCounter) return; plan(&ds, plan_copy, dive.get(), dcNr, 1, longer, cache, true, false); - plan_copy.dp.clear(); save.restore(&ds, false); plan_copy.dp.back().time -= delta_time.seconds; if (my_instance != instanceCounter) return; plan(&ds, plan_copy, dive.get(), dcNr, 1, shorter, cache, true, false); - plan_copy.dp.clear(); save.restore(&ds, false); char buf[200];