From ef24ec632da12f272eddcf9924eacde9260597a2 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 1 Apr 2021 18:10:11 +0100 Subject: Constify variables within loops. --- src/modules/m_httpd_config.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/m_httpd_config.cpp') diff --git a/src/modules/m_httpd_config.cpp b/src/modules/m_httpd_config.cpp index a42fec8ea..61abbadfa 100644 --- a/src/modules/m_httpd_config.cpp +++ b/src/modules/m_httpd_config.cpp @@ -46,7 +46,7 @@ class ModuleHttpConfig : public Module, public HTTPRequestEventListener ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Handling HTTP request for %s", request.GetPath().c_str()); std::stringstream buffer; - for (auto& [_, tag] : ServerInstance->Config->config_data) + for (const auto& [_, tag] : ServerInstance->Config->config_data) { // Show the location of the tag in a comment. buffer << "# " << tag->source.str() << std::endl @@ -55,7 +55,7 @@ class ModuleHttpConfig : public Module, public HTTPRequestEventListener // Print out the tag with all keys aligned vertically. const std::string indent(tag->name.length() + 2, ' '); bool first = true; - for (auto& [key, value] : tag->GetItems()) + for (const auto& [key, value] : tag->GetItems()) { if (!first) buffer << std::endl << indent; -- cgit v1.3.1-10-gc9f91