Style fix: use const Csock* in for-each loop

This commit is contained in:
Alexey Sokolov
2019-08-12 08:20:15 +01:00
parent 9216abe5a7
commit 773f4789a2
2 changed files with 11 additions and 14 deletions

View File

@@ -76,11 +76,9 @@ CZNCSock::CZNCSock(const CString& sHost, u_short port, int timeout)
}
unsigned int CSockManager::GetAnonConnectionCount(const CString& sIP) const {
const_iterator it;
unsigned int ret = 0;
for (it = begin(); it != end(); ++it) {
Csock* pSock = *it;
for (const Csock* pSock : *this) {
// Logged in CClients have "USR::<username>" as their sockname
if (pSock->GetType() == Csock::INBOUND && pSock->GetRemoteIP() == sIP &&
!pSock->GetSockName().StartsWith("USR::")) {