[tidy] modernize-loop-convert
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user