From 9b8eed7821c7e55c5e2eccd252184a6d2123e3cd Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 21 Apr 2020 09:34:40 +0200 Subject: 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 --- qt-models/cylindermodel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'qt-models/cylindermodel.cpp') 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 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(); } -- cgit v1.2.3-70-g09d2