diff options
| author | Sadie Powell <sadie@witchery.services> | 2023-10-10 21:14:50 +0100 |
|---|---|---|
| committer | Sadie Powell <sadie@witchery.services> | 2023-10-11 15:51:52 +0100 |
| commit | a3241065c55fd2a69e8793b89a5d0b1a957b3fd0 (patch) | |
| tree | 82f80ce2f3bbbdc1c1ef05fe611093cf0b34eab6 /modules/pseudoclients/botserv.cpp | |
| parent | dc371aad6d059dbf7f30f6878c680532bedd4146 (diff) | |
Start migrating to range-based for loops.
Diffstat (limited to 'modules/pseudoclients/botserv.cpp')
| -rw-r--r-- | modules/pseudoclients/botserv.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp index 7fa60b8e6..25cf8ab88 100644 --- a/modules/pseudoclients/botserv.cpp +++ b/modules/pseudoclients/botserv.cpp @@ -34,8 +34,8 @@ class BotServCore : public Module if (chan->ci && chan->ci->bi == user) { const Anope::string &botmodes = Config->GetModule(this)->Get<const Anope::string>("botmodes"); - for (unsigned i = 0; i < botmodes.length(); ++i) - chan->SetMode(chan->ci->bi, ModeManager::FindChannelModeByChar(botmodes[i]), chan->ci->bi->GetUID()); + for (auto botmode : botmodes) + chan->SetMode(chan->ci->bi, ModeManager::FindChannelModeByChar(botmode), chan->ci->bi->GetUID()); } } @@ -56,12 +56,10 @@ class BotServCore : public Module BotInfo *bi = user->server == Me ? dynamic_cast<BotInfo *>(user) : NULL; if (bi && Config->GetModule(this)->Get<bool>("smartjoin")) { - std::vector<Anope::string> bans = c->GetModeList("BAN"); - /* We check for bans */ - for (unsigned int i = 0; i < bans.size(); ++i) + for (const auto &entry : c->GetModeList("BAN")) { - Entry ban("BAN", bans[i]); + Entry ban("BAN", entry); if (ban.Matches(user)) c->RemoveMode(NULL, "BAN", ban.GetMask()); } |
