Fix GetClients() const correctness

It’s dangerous to give a non-const reference to an internal
container that the API users are not supposed to modify.
This commit is contained in:
J-P Nurmi
2014-10-01 20:28:59 +02:00
parent 705e79f808
commit 4fe249280e
8 changed files with 17 additions and 17 deletions
+2 -2
View File
@@ -141,8 +141,8 @@ void CChan::JoinUser(bool bForce, const CString& sKey, CClient* pClient) {
CString sLine = sPre;
CString sPerm, sNick;
vector<CClient*>& vpClients = m_pNetwork->GetClients();
for (vector<CClient*>::iterator it = vpClients.begin(); it != vpClients.end(); ++it) {
const vector<CClient*>& vpClients = m_pNetwork->GetClients();
for (vector<CClient*>::const_iterator it = vpClients.begin(); it != vpClients.end(); ++it) {
CClient* pThisClient;
if (!pClient)
pThisClient = *it;