summaryrefslogtreecommitdiff
path: root/src/messages.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 /src/messages.cpp
parentdc371aad6d059dbf7f30f6878c680532bedd4146 (diff)
Start migrating to range-based for loops.
Diffstat (limited to 'src/messages.cpp')
-rw-r--r--src/messages.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/messages.cpp b/src/messages.cpp
index 701df60a1..2aaae177f 100644
--- a/src/messages.cpp
+++ b/src/messages.cpp
@@ -43,8 +43,10 @@ void Capab::Run(MessageSource &source, const std::vector<Anope::string> &params,
Servers::Capab.insert(token);
}
else
- for (unsigned i = 0; i < params.size(); ++i)
- Servers::Capab.insert(params[i]);
+ {
+ for (const auto &param : params)
+ Servers::Capab.insert(param);
+ }
}
void Error::Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags)
@@ -127,10 +129,8 @@ void Join::SJoin(MessageSource &source, const Anope::string &chan, time_t ts, co
*/
c->SetModesInternal(source, modes, ts, !c->syncing);
- for (std::list<SJoinUser>::const_iterator it = users.begin(), it_end = users.end(); it != it_end; ++it)
+ for (const auto &[status, u] : users)
{
- const ChannelStatus &status = it->first;
- User *u = it->second;
keep_their_modes = ts <= c->creation_time; // OnJoinChannel can call modules which can modify this channel's ts
if (c->FindUser(u))
@@ -426,10 +426,8 @@ void Stats::Run(MessageSource &source, const std::vector<Anope::string> &params,
IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
else
{
- for (unsigned i = 0; i < Oper::opers.size(); ++i)
+ for (auto *o : Oper::opers)
{
- Oper *o = Oper::opers[i];
-
const NickAlias *na = NickAlias::Find(o->name);
if (na)
IRCD->SendNumeric(243, source.GetSource(), "O * * %s %s 0", o->name.c_str(), o->ot->GetName().replace_all_cs(" ", "_").c_str());