Desktop: fix index in weightsystems_equal()

The weightsystem_equal() function compares weightsystems of two dives
to decide whether the "commit changes" message should be shown and
to decide which dives are edited when changing multiple dives.

Due to an index mixup the function returned wrong results for
more than two weightsystems. Fix it.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-07-27 16:44:24 +02:00 committed by Dirk Hohndel
parent 9485ace709
commit 999a63a5bb

View file

@ -674,7 +674,7 @@ bool weightsystems_equal(const dive *d1, const dive *d2)
if (d1->weightsystems.nr != d2->weightsystems.nr) if (d1->weightsystems.nr != d2->weightsystems.nr)
return false; return false;
for (int i = 0; i < d1->weightsystems.nr; ++i) { for (int i = 0; i < d1->weightsystems.nr; ++i) {
if (!same_weightsystem(d1->weightsystems.weightsystems[0], d2->weightsystems.weightsystems[i])) if (!same_weightsystem(d1->weightsystems.weightsystems[i], d2->weightsystems.weightsystems[i]))
return false; return false;
} }
return true; return true;