diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:21:43 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-29 14:18:06 +0100 |
commit | e7c285e3423ddd660447f6a6fc6bbae25f99f386 (patch) | |
tree | 1d700f09a5e96a2a0d390af30581097bdec0bf77 /src/configuration.cpp | |
parent | e1a7c1d0ca30c2c4a293ffbff6b9c51c881d23e3 (diff) | |
download | mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.gz mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.bz2 mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.xz mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.zip |
Apply C++11 fixits
modernize-loop-convert
modernize-deprecated-headers
Diffstat (limited to 'src/configuration.cpp')
-rw-r--r-- | src/configuration.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp index 34febf22..74104ec6 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -286,14 +286,13 @@ void Configuration::init(const std::string &filename, bool useResManager) void ConfigurationObject::writeToXML(xmlTextWriterPtr writer) { - for (Options::const_iterator i = mOptions.begin(), i_end = mOptions.end(); - i != i_end; ++i) + for (const auto &option : mOptions) { xmlTextWriterStartElement(writer, BAD_CAST "option"); xmlTextWriterWriteAttribute(writer, - BAD_CAST "name", BAD_CAST i->first.c_str()); + BAD_CAST "name", BAD_CAST option.first.c_str()); xmlTextWriterWriteAttribute(writer, - BAD_CAST "value", BAD_CAST i->second.c_str()); + BAD_CAST "value", BAD_CAST option.second.c_str()); xmlTextWriterEndElement(writer); } @@ -306,11 +305,10 @@ void ConfigurationObject::writeToXML(xmlTextWriterPtr writer) xmlTextWriterWriteAttribute(writer, BAD_CAST "name", BAD_CAST name); // Recurse on all elements - for (auto - elt_it = it->second.begin(); elt_it != it->second.end(); elt_it++) + for (auto element : it->second) { xmlTextWriterStartElement(writer, BAD_CAST name); - (*elt_it)->writeToXML(writer); + element->writeToXML(writer); xmlTextWriterEndElement(writer); } |