diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index 3d11eef7b..d5b9f72c2 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -271,20 +271,18 @@ public: { std::stringstream ss; ss << "Feature ( id=" << id_ << std::endl; - context_type::map_type::const_iterator itr = ctx_->mapping_.begin(); - context_type::map_type::const_iterator end = ctx_->mapping_.end(); - for ( ;itr!=end; ++itr) + for (auto const& kv : ctx_->mapping_) { - std::size_t index = itr->second; + std::size_t index = kv.second; if (index < data_.size()) { - if (data_[itr->second] == mapnik::value_null()) + if (data_[kv.second] == mapnik::value_null()) { - ss << " " << itr->first << ":null" << std::endl; + ss << " " << kv.first << ":null" << std::endl; } else { - ss << " " << itr->first << ":" << data_[itr->second] << std::endl; + ss << " " << kv.first << ":" << data_[kv.second] << std::endl; } } } diff --git a/include/mapnik/internal/dump_xml.hpp b/include/mapnik/internal/dump_xml.hpp index 946607cfa..f8075907f 100644 --- a/include/mapnik/internal/dump_xml.hpp +++ b/include/mapnik/internal/dump_xml.hpp @@ -5,8 +5,8 @@ namespace mapnik { -/* Debug dump ptree XML representation. - */ +// Debug dump ptree XML representation. + void dump_xml(xml_node const& xml, unsigned level=0) { std::string indent; @@ -15,21 +15,17 @@ void dump_xml(xml_node const& xml, unsigned level=0) { indent += " "; } - xml_node::attribute_map const& attr = xml.get_attributes(); + xml_node::attribute_map const& attr_map = xml.get_attributes(); std::cerr << indent <<"[" << xml.name(); - xml_node::attribute_map::const_iterator aitr = attr.begin(); - xml_node::attribute_map::const_iterator aend = attr.end(); - for (;aitr!=aend; aitr++) + for (auto const& attr : attr_map) { - std::cerr << " (" << aitr->first << ", " << aitr->second.value << ", " << aitr->second.processed << ")"; + std::cerr << " (" << attr.first << ", " << attr.second.value << ", " << attr.second.processed << ")"; } std::cerr << "]" << "\n"; if (xml.is_text()) std::cerr << indent << "text: '" << xml.text() << "'\n"; - xml_node::const_iterator itr = xml.begin(); - xml_node::const_iterator end = xml.end(); - for (; itr!=end; itr++) + for (auto const& child : xml) { - dump_xml(*itr, level+1); + dump_xml(child, level+1); } std::cerr << indent << "[/" << xml.name() << "]" << "\n"; }