Cleanup: use total_weight() in DiveObjectHelper::sumWeight()

Don't reimplement the summation of weights.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-06-05 23:02:25 +02:00 committed by Dirk Hohndel
parent 3e88bd686f
commit 7bfec6fa19

View file

@ -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);
}