summaryrefslogtreecommitdiffstats
path: root/qt-models/cylindermodel.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-21 09:34:40 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-04-21 07:50:38 -0700
commit9b8eed7821c7e55c5e2eccd252184a6d2123e3cd (patch)
tree8e080b1ca4a2daad4eaff069287894ed1990f0ad /qt-models/cylindermodel.cpp
parenta8aa8971176239fa4d428aaa4599d1f996e11885 (diff)
downloadsubsurface-9b8eed7821c7e55c5e2eccd252184a6d2123e3cd.tar.gz
cleanup: replace constructs of the type &vector[0] by vector.data()
It appears that some misguided compiler / library combinations crash on &vector[0] for empty vectors. Even though very unfriendly, they are technically correct, so let's remove these constructs. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/cylindermodel.cpp')
-rw-r--r--qt-models/cylindermodel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index 04abe2fdb..6759670c6 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -548,8 +548,8 @@ void CylindersModel::remove(QModelIndex index)
endRemoveRows();
std::vector<int> mapping = get_cylinder_map_for_remove(d->cylinders.nr + 1, index.row());
- cylinder_renumber(d, &mapping[0]);
- DivePlannerPointsModel::instance()->cylinderRenumber(&mapping[0]);
+ cylinder_renumber(d, mapping.data());
+ DivePlannerPointsModel::instance()->cylinderRenumber(mapping.data());
}
void CylindersModel::cylinderAdded(struct dive *changed, int pos)
@@ -601,9 +601,9 @@ void CylindersModel::moveAtFirst(int cylid)
std::iota(mapping.begin(), mapping.begin() + cylid, 1);
mapping[cylid] = 0;
std::iota(mapping.begin() + (cylid + 1), mapping.end(), cylid);
- cylinder_renumber(d, &mapping[0]);
+ cylinder_renumber(d, mapping.data());
if (inPlanner)
- DivePlannerPointsModel::instance()->cylinderRenumber(&mapping[0]);
+ DivePlannerPointsModel::instance()->cylinderRenumber(mapping.data());
endMoveRows();
}