summaryrefslogtreecommitdiff
path: root/modules/commands/cs_clone.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/commands/cs_clone.cpp
parentdc371aad6d059dbf7f30f6878c680532bedd4146 (diff)
Start migrating to range-based for loops.
Diffstat (limited to 'modules/commands/cs_clone.cpp')
-rw-r--r--modules/commands/cs_clone.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp
index 84c7d91cb..c287f6a0b 100644
--- a/modules/commands/cs_clone.cpp
+++ b/modules/commands/cs_clone.cpp
@@ -99,11 +99,9 @@ class CommandCSClone : public Command
void CopyLevels(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
{
- const Anope::map<int16_t> &cilevels = ci->GetLevelEntries();
-
- for (Anope::map<int16_t>::const_iterator it = cilevels.begin(); it != cilevels.end(); ++it)
+ for (const auto &[priv, level] : ci->GetLevelEntries())
{
- target_ci->SetLevel(it->first, it->second);
+ target_ci->SetLevel(priv, level);
}
source.Reply(_("All level entries from \002%s\002 have been cloned into \002%s\002."), ci->name.c_str(), target_ci->name.c_str());
@@ -199,8 +197,8 @@ public:
const Anope::string settings[] = { "NOAUTOOP", "CS_KEEP_MODES", "PEACE", "PERSIST", "RESTRICTED",
"CS_SECURE", "SECUREFOUNDER", "SECUREOPS", "SIGNKICK", "SIGNKICK_LEVEL", "CS_NO_EXPIRE" };
- for (unsigned int i = 0; i < sizeof(settings) / sizeof(Anope::string); ++i)
- CopySetting(ci, target_ci, settings[i]);
+ for (const auto &setting : settings)
+ CopySetting(ci, target_ci, setting);
CopyAccess(source, ci, target_ci);
CopyAkick(source, ci, target_ci);