mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
a8aa897117
commit
9b8eed7821
3 changed files with 6 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue