summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-06-05 23:02:25 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-06-19 13:11:10 -0700
commit7bfec6fa19b162781efba2c320b503b8bd473132 (patch)
tree6ef34013f729627391e5a0e8dda237250a2b15cb
parent3e88bd686fe2f01d3a32b32e6bbff9d92ebfac6d (diff)
downloadsubsurface-7bfec6fa19b162781efba2c320b503b8bd473132.tar.gz
Cleanup: use total_weight() in DiveObjectHelper::sumWeight()
Don't reimplement the summation of weights. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--core/subsurface-qt/DiveObjectHelper.cpp5
1 files changed, 1 insertions, 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);
}