summaryrefslogtreecommitdiff
path: root/src/xline.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/xline.cpp
parentdc371aad6d059dbf7f30f6878c680532bedd4146 (diff)
Start migrating to range-based for loops.
Diffstat (limited to 'src/xline.cpp')
-rw-r--r--src/xline.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/xline.cpp b/src/xline.cpp
index 26e39fa5d..1e39e9840 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -224,10 +224,8 @@ void XLineManager::UnregisterXLineManager(XLineManager *xlm)
void XLineManager::CheckAll(User *u)
{
- for (std::list<XLineManager *>::iterator it = XLineManagers.begin(), it_end = XLineManagers.end(); it != it_end; ++it)
+ for (auto *xlm : XLineManagers)
{
- XLineManager *xlm = *it;
-
if (xlm->CheckAllXLines(u))
break;
}
@@ -361,9 +359,8 @@ void XLineManager::Clear()
std::vector<XLine *> xl;
this->xlines->swap(xl);
- for (unsigned i = 0; i < xl.size(); ++i)
+ for (auto *x : xl)
{
- XLine *x = xl[i];
if (!x->id.empty())
XLinesByUID->erase(x->id);
delete x;
@@ -427,10 +424,8 @@ XLine* XLineManager::HasEntry(const Anope::string &mask)
it->second->QueueUpdate();
return it->second;
}
- for (unsigned i = 0, end = this->xlines->size(); i < end; ++i)
+ for (auto *x : *this->xlines)
{
- XLine *x = this->xlines->at(i);
-
if (x->mask.equals_ci(mask))
{
x->QueueUpdate();