1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 04:03:13 +02:00

Start migrating to range-based for loops.

This commit is contained in:
Sadie Powell
2023-10-10 21:14:50 +01:00
parent dc371aad6d
commit a3241065c5
146 changed files with 1157 additions and 1459 deletions
+4 -6
View File
@@ -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);