summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-06-11 12:23:13 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2018-06-11 14:45:30 +0300
commit95a6fcdd26c93ebea2726c43f8afdf04b4245830 (patch)
treef701857b906c808fbfbb42c9b75662ab8e730a96
parent5c01142b902aa35a54fff72bc1ca9c708df16794 (diff)
downloadqtlocation-mapboxgl-95a6fcdd26c93ebea2726c43f8afdf04b4245830.tar.gz
[qt] Fix asMapboxGLFeatureIdentifier iterator traversal
-rw-r--r--platform/qt/src/qt_geojson.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/platform/qt/src/qt_geojson.cpp b/platform/qt/src/qt_geojson.cpp
index 80377de64d..9d0a3e96eb 100644
--- a/platform/qt/src/qt_geojson.cpp
+++ b/platform/qt/src/qt_geojson.cpp
@@ -72,10 +72,8 @@ mbgl::Value asMapboxGLPropertyValue(const QVariant &value) {
auto valueMap = [](const QVariantMap &map) {
std::unordered_map<std::string, mbgl::Value> mbglMap;
mbglMap.reserve(map.size());
- auto it = map.constBegin();
- while (it != map.constEnd()) {
+ for (auto it = map.constBegin(); it != map.constEnd(); ++it) {
mbglMap.emplace(std::make_pair(it.key().toStdString(), asMapboxGLPropertyValue(it.value())));
- ++it;
}
return mbglMap;
};
@@ -132,8 +130,7 @@ mbgl::FeatureIdentifier asMapboxGLFeatureIdentifier(const QVariant &id) {
mbgl::Feature asMapboxGLFeature(const QMapbox::Feature &feature) {
mbgl::PropertyMap properties;
properties.reserve(feature.properties.size());
- auto it = feature.properties.constBegin();
- while (it != feature.properties.constEnd()) {
+ for (auto it = feature.properties.constBegin(); it != feature.properties.constEnd(); ++it) {
properties.emplace(std::make_pair(it.key().toStdString(), asMapboxGLPropertyValue(it.value())));
}