cylinders: remove redundant index check in the model

There is a warning when the code tries to access a non-existing
cylinder, since that indicates that something went out of sync.

However, this warning can never trigger because the bounds are
checked before. Remove the first of the two redundant checks.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-11-20 09:00:15 +01:00 committed by Dirk Hohndel
parent 8afb0dedc9
commit 3466d0c44d

View file

@ -152,7 +152,7 @@ bool CylindersModel::cylinderUsed(int i) const
QVariant CylindersModel::data(const QModelIndex &index, int role) const
{
if (!d || !index.isValid() || index.row() >= d->cylinders.nr)
if (!d || !index.isValid())
return QVariant();
if (index.row() >= d->cylinders.nr) {