diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-05-12 16:19:05 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-05-12 18:07:36 +0300 |
commit | 19c15ab557728247ea900118aaace1e45763baf4 (patch) | |
tree | 90e4d0070ad4e1d760babc3b6bc53d9ec5ca4408 | |
parent | c6eb4afe0ebdabfd436a80adf8af505779859404 (diff) | |
download | qtlocation-mapboxgl-19c15ab557728247ea900118aaace1e45763baf4.tar.gz |
[tidy] modernize-loop-convert
-rw-r--r-- | src/csscolorparser/csscolorparser.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/style/style.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/text/glyph_atlas.cpp | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/csscolorparser/csscolorparser.cpp b/src/csscolorparser/csscolorparser.cpp index 5658f2b63b..4d1c6a3d65 100644 --- a/src/csscolorparser/csscolorparser.cpp +++ b/src/csscolorparser/csscolorparser.cpp @@ -186,9 +186,9 @@ optional<Color> parse(const std::string& css_str) { std::transform(str.begin(), str.end(), str.begin(), ::tolower); - for (size_t i = 0; i < namedColorCount; i++) { - if (str == namedColors[i].name) { - return { namedColors[i].color }; + for (const auto& namedColor : namedColors) { + if (str == namedColor.name) { + return { namedColor.color }; } } diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 97d30b2494..9cd8cda1ec 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -583,8 +583,8 @@ RenderData Style::getRenderData(MapDebugOptions debugOptions, float angle) const } std::vector<std::reference_wrapper<RenderTile>> sortedTilesForInsertion; - for (auto tileIt = sortedTiles.begin(); tileIt != sortedTiles.end(); ++tileIt) { - auto& tile = tileIt->get(); + for (auto& sortedTile : sortedTiles) { + auto& tile = sortedTile.get(); if (!tile.tile.isRenderable()) { continue; } diff --git a/src/mbgl/text/glyph_atlas.cpp b/src/mbgl/text/glyph_atlas.cpp index 4feaab01f9..b43971f704 100644 --- a/src/mbgl/text/glyph_atlas.cpp +++ b/src/mbgl/text/glyph_atlas.cpp @@ -207,8 +207,8 @@ Rect<uint16_t> GlyphAtlas::addGlyph(GlyphValue& value) { } void GlyphAtlas::removeGlyphValues(GlyphRequestor& requestor, std::map<GlyphID, GlyphValue>& values) { - for (auto it = values.begin(); it != values.end(); it++) { - GlyphValue& value = it->second; + for (auto& it : values) { + GlyphValue& value = it.second; if (value.ids.erase(&requestor) && value.ids.empty() && value.rect) { const Rect<uint16_t>& rect = *value.rect; @@ -228,8 +228,8 @@ void GlyphAtlas::removeGlyphValues(GlyphRequestor& requestor, std::map<GlyphID, } void GlyphAtlas::removePendingRanges(mbgl::GlyphRequestor& requestor, std::map<GlyphRange, GlyphRequest>& ranges) { - for (auto it = ranges.begin(); it != ranges.end(); it++) { - it->second.requestors.erase(&requestor); + for (auto& range : ranges) { + range.second.requestors.erase(&requestor); } } |