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/declarativemaps/qdeclarativepolylinemapitem_p_p.h | |
parent | 517e4f284e1808ecddc998d73b4b554880733381 (diff) | |
download | qtlocation-366a6379fb80e8c223ae57b2fd791ffdfeacdbf3.tar.gz |
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/declarativemaps/qdeclarativepolylinemapitem_p_p.h')
-rw-r--r-- | src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h b/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h index ca2fabce..50a1561b 100644 --- a/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h +++ b/src/location/declarativemaps/qdeclarativepolylinemapitem_p_p.h @@ -339,14 +339,14 @@ public: if (m_screenVertices->size()) a = p.wrappedMapProjectionToItemPosition(p.wrapMapProjection(m_screenVertices->first().toDoubleVector2D())); QDoubleVector2D b; - for (int i = 1; i < m_screenVertices->size(); ++i) - { + for (qsizetype i = 1; i < m_screenVertices->size(); ++i) { + const auto &screenVertice = m_screenVertices->at(i); if (!a.isFinite()) { - a = p.wrappedMapProjectionToItemPosition(p.wrapMapProjection(m_screenVertices->at(i).toDoubleVector2D())); + a = p.wrappedMapProjectionToItemPosition(p.wrapMapProjection(screenVertice.toDoubleVector2D())); continue; } - b = p.wrappedMapProjectionToItemPosition(p.wrapMapProjection(m_screenVertices->at(i).toDoubleVector2D())); + b = p.wrappedMapProjectionToItemPosition(p.wrapMapProjection(screenVertice.toDoubleVector2D())); if (!b.isFinite()) { a = b; continue; |