summaryrefslogtreecommitdiff
path: root/modules/m_xmlrpc.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2023-10-10 21:14:50 +0100
committerSadie Powell <sadie@witchery.services>2023-10-11 15:51:52 +0100
commita3241065c55fd2a69e8793b89a5d0b1a957b3fd0 (patch)
tree82f80ce2f3bbbdc1c1ef05fe611093cf0b34eab6 /modules/m_xmlrpc.cpp
parentdc371aad6d059dbf7f30f6878c680532bedd4146 (diff)
Start migrating to range-based for loops.
Diffstat (limited to 'modules/m_xmlrpc.cpp')
-rw-r--r--modules/m_xmlrpc.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/m_xmlrpc.cpp b/modules/m_xmlrpc.cpp
index 1855cda2e..2ced4bca9 100644
--- a/modules/m_xmlrpc.cpp
+++ b/modules/m_xmlrpc.cpp
@@ -164,10 +164,8 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage
request.data.push_back(data);
}
- for (unsigned i = 0; i < this->events.size(); ++i)
+ for (auto *e : this->events)
{
- XMLRPCEvent *e = this->events[i];
-
if (!e->Run(this, client, request))
return false;
else if (!request.get_replies().empty())
@@ -188,8 +186,8 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage
request.reply("id", request.id);
Anope::string r = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<methodResponse>\n<params>\n<param>\n<value>\n<struct>\n";
- for (std::map<Anope::string, Anope::string>::const_iterator it = request.get_replies().begin(); it != request.get_replies().end(); ++it)
- r += "<member>\n<name>" + it->first + "</name>\n<value>\n<string>" + this->Sanitize(it->second) + "</string>\n</value>\n</member>\n";
+ for (const auto &[name, value] : request.get_replies())
+ r += "<member>\n<name>" + name + "</name>\n<value>\n<string>" + this->Sanitize(value) + "</string>\n</value>\n</member>\n";
r += "</struct>\n</value>\n</param>\n</params>\n</methodResponse>";
request.r.Write(r);