diff options
| author | 2020-11-10 14:58:00 +0000 | |
|---|---|---|
| committer | 2020-11-10 14:58:00 +0000 | |
| commit | 36a0f48150459b9fbe24c6f76ca705410211a8ac (patch) | |
| tree | 42aacb3f9f7cb66ca3a5e1b6c1ed51e0740e8b04 /src/modules | |
| parent | Fix inconsistencies between the CI environments. (diff) | |
Use a range-based for loop in the httpd_config module.
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/m_httpd_config.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/m_httpd_config.cpp b/src/modules/m_httpd_config.cpp index 555488cd6..51d90a152 100644 --- a/src/modules/m_httpd_config.cpp +++ b/src/modules/m_httpd_config.cpp @@ -55,13 +55,14 @@ class ModuleHttpConfig : public Module, public HTTPRequestEventListener // Print out the tag with all keys aligned vertically. const std::string indent(tag->name.length() + 2, ' '); - const ConfigTag::Items& items = tag->GetItems(); - for (ConfigTag::Items::const_iterator kiter = items.begin(); kiter != items.end(); ) + bool first = true; + for (auto& [key, value] : tag->GetItems()) { - ConfigTag::Items::const_iterator curr = kiter++; - buffer << curr->first << "=\"" << ServerConfig::Escape(curr->second) << '"'; - if (kiter != items.end()) + if (!first) buffer << std::endl << indent; + + buffer << key << "=\"" << ServerConfig::Escape(value) << '"'; + first = false; } buffer << '>' << std::endl << std::endl; } |
