summaryrefslogtreecommitdiff
path: root/modules/extra/m_ldap.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/extra/m_ldap.cpp
parentdc371aad6d059dbf7f30f6878c680532bedd4146 (diff)
Start migrating to range-based for loops.
Diffstat (limited to 'modules/extra/m_ldap.cpp')
-rw-r--r--modules/extra/m_ldap.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp
index aa34162d0..a92385c7d 100644
--- a/modules/extra/m_ldap.cpp
+++ b/modules/extra/m_ldap.cpp
@@ -315,10 +315,8 @@ class LDAPService : public LDAPProvider, public Thread, public Condition
this->Lock();
- for (unsigned int i = 0; i < this->queries.size(); ++i)
+ for (auto *req : this->queries)
{
- LDAPRequest *req = this->queries[i];
-
/* queries have no results yet */
req->result = new LDAPResult();
req->result->type = req->type;
@@ -330,10 +328,8 @@ class LDAPService : public LDAPProvider, public Thread, public Condition
}
this->queries.clear();
- for (unsigned int i = 0; i < this->results.size(); ++i)
+ for (const auto *req : this->queries)
{
- LDAPRequest *req = this->results[i];
-
/* even though this may have already finished successfully we return that it didn't */
req->result->error = "LDAP Interface is going away";
if (req->inter)
@@ -454,9 +450,8 @@ class LDAPService : public LDAPProvider, public Thread, public Condition
return;
}
- for (unsigned int i = 0; i < q.size(); ++i)
+ for (auto *req : q)
{
- LDAPRequest *req = q[i];
int ret = req->run();
if (ret == LDAP_SERVER_DOWN || ret == LDAP_TIMEOUT)
@@ -633,9 +628,8 @@ class ModuleLDAP : public Module, public Pipe
results.swap(s->results);
s->Unlock();
- for (unsigned int i = 0; i < results.size(); ++i)
+ for (const auto *req : results)
{
- LDAPRequest *req = results[i];
LDAPInterface *li = req->inter;
LDAPResult *r = req->result;