From 7bfec6fa19b162781efba2c320b503b8bd473132 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 5 Jun 2019 23:02:25 +0200 Subject: [PATCH] Cleanup: use total_weight() in DiveObjectHelper::sumWeight() Don't reimplement the summation of weights. Signed-off-by: Berthold Stoeger --- core/subsurface-qt/DiveObjectHelper.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index 3f4649c42..35ec2df2a 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -352,10 +352,7 @@ int DiveObjectHelper::visibility() const QString DiveObjectHelper::sumWeight() const { - weight_t sum = { 0 }; - for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++){ - sum.grams += m_dive->weightsystem[i].weight.grams; - } + weight_t sum = { total_weight(m_dive) }; return get_weight_string(sum, true); }