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/commands/cs_akick.cpp | |
parent | dc371aad6d059dbf7f30f6878c680532bedd4146 (diff) |
Start migrating to range-based for loops.
Diffstat (limited to 'modules/commands/cs_akick.cpp')
-rw-r--r-- | modules/commands/cs_akick.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 04ee17da3..78215dacd 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -96,10 +96,9 @@ class CommandCSAKick : public Command /* Check excepts BEFORE we get this far */ if (ci->c) { - std::vector<Anope::string> modes = ci->c->GetModeList("EXCEPT"); - for (unsigned int i = 0; i < modes.size(); ++i) + for (const auto &mode : ci->c->GetModeList("EXCEPT")) { - if (Anope::Match(modes[i], mask)) + if (Anope::Match(mode, mask)) { source.Reply(CHAN_EXCEPTED, mask.c_str(), ci->name.c_str()); return; @@ -129,10 +128,8 @@ class CommandCSAKick : public Command { /* Match against all currently online users with equal or * higher access. - Viper */ - for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it) + for (const auto &[_, u2] : UserListByNick) { - User *u2 = it->second; - AccessGroup nc_access = ci->AccessFor(nc), u_access = source.AccessFor(ci); Entry entry_mask("", mask); @@ -145,9 +142,9 @@ class CommandCSAKick : public Command /* Match against the lastusermask of all nickalias's with equal * or higher access. - Viper */ - for (nickalias_map::const_iterator it = NickAliasList->begin(), it_end = NickAliasList->end(); it != it_end; ++it) + for (const auto &[_, na2] : *NickAliasList) { - na = it->second; + na = na2; AccessGroup nc_access = ci->AccessFor(na->nc), u_access = source.AccessFor(ci); if (na->nc && (na->nc == ci->GetFounder() || nc_access >= u_access)) @@ -373,8 +370,8 @@ class CommandCSAKick : public Command source.Reply(_("Autokick list for %s:"), ci->name.c_str()); - for (unsigned i = 0; i < replies.size(); ++i) - source.Reply(replies[i]); + for (const auto &reply : replies) + source.Reply(reply); source.Reply(_("End of autokick list")); } |