diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-10 14:15:17 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-14 20:05:49 +0200 |
commit | 366a6379fb80e8c223ae57b2fd791ffdfeacdbf3 (patch) | |
tree | 379c1b6a8ef4e942de9d99f231fe96e09dcf5eae /src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp | |
parent | 517e4f284e1808ecddc998d73b4b554880733381 (diff) |
Refactor: for loops
Replace indexed for loops with ranged for, replace int with qsizetype
otherwise as appropriate. Apply const and line breaks in surrounding
code.
Pick-to: 6.2
Change-Id: I1c2ee372545b8ab2cbb84c4b4b97ae52dedff1d0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp')
-rw-r--r-- | src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp b/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp index 68b2f2f4..8b2a7c13 100644 --- a/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp +++ b/src/location/declarativeplaces/qdeclarativesearchresultmodel.cpp @@ -907,7 +907,7 @@ void QDeclarativeSearchResultModel::updateLayout(const QList<QPlace> &favoritePl } m_resultsBuffer.clear(); - for (int i = start; i < m_results.count(); ++i) { + for (qsizetype i = start; i < m_results.count(); ++i) { const QPlaceSearchResult &result = m_results.at(i); if (result.type() == QPlaceSearchResult::PlaceResult) { @@ -992,7 +992,7 @@ void QDeclarativeSearchResultModel::removePageRow(int row) */ int QDeclarativeSearchResultModel::getRow(const QString &placeId) const { - for (int i = 0; i < m_places.count(); ++i) { + for (qsizetype i = 0; i < m_places.count(); ++i) { if (!m_places.at(i)) continue; else if (m_places.at(i)->placeId() == placeId) |