@@ -586,9 +586,7 @@ void XMLFormatter::get_attrs_str(const FormatterAttrs *attrs, std::string& attrs
586586{
587587 CachedStackStringStream css;
588588
589- for (std::list<std::pair<std::string, std::string> >::const_iterator iter = attrs->attrs .begin ();
590- iter != attrs->attrs .end (); ++iter) {
591- std::pair<std::string, std::string> p = *iter;
589+ for (const auto &p : attrs->attrs ) {
592590 *css << " " << p.first << " =" << " \" " << p.second << " \" " ;
593591 }
594592
@@ -849,9 +847,9 @@ size_t TableFormatter::m_vec_index(std::string_view name)
849847std::string TableFormatter::get_section_name (std::string_view name)
850848{
851849 std::string t_name{name};
852- for (size_t i = 0 ; i < m_section. size (); i++ ) {
850+ for (const auto &i : m_section) {
853851 t_name.insert (0 , " :" );
854- t_name.insert (0 , m_section[i] );
852+ t_name.insert (0 , i );
855853 }
856854 if (m_section_open) {
857855 std::stringstream lss;
@@ -963,9 +961,7 @@ void TableFormatter::get_attrs_str(const FormatterAttrs *attrs, std::string& att
963961{
964962 CachedStackStringStream css;
965963
966- for (std::list<std::pair<std::string, std::string> >::const_iterator iter = attrs->attrs .begin ();
967- iter != attrs->attrs .end (); ++iter) {
968- std::pair<std::string, std::string> p = *iter;
964+ for (const auto &p : attrs->attrs ) {
969965 *css << " " << p.first << " =" << " \" " << p.second << " \" " ;
970966 }
971967
0 commit comments