mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: use range based loops in model
There were a number of classical "for (i = 0; i < size; ++i)" loops. Replace them either by plain range based loops if the index is not used or by enumerated_range() loops. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
727d519046
commit
b63073e203
2 changed files with 22 additions and 20 deletions
|
@ -206,8 +206,8 @@ void DivePictureModel::picturesAdded(dive *d, QVector<PictureObj> picsIn)
|
|||
// Convert the picture-data into our own format
|
||||
std::vector<PictureEntry> pics;
|
||||
pics.reserve(picsIn.size());
|
||||
for (int i = 0; i < picsIn.size(); ++i)
|
||||
pics.push_back(PictureEntry(d, picsIn[i]));
|
||||
for (const PictureObj &pic: picsIn)
|
||||
pics.push_back(PictureEntry(d, pic));
|
||||
|
||||
// Insert batch-wise to avoid too many reloads
|
||||
pictures.reserve(pictures.size() + pics.size());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue