mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
Turn CChan::m_msNicks into a map<CString, CNick>
Saving a pointer in a map seems like a bad idea and means we have to delete all the contained stuff by hand when the channel is destroyed. This requires us to loop through the channel which is slow. A map is meant as a container, so use it as one and directly save the stuff we want it to save in there. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2175 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -55,9 +55,9 @@ unsigned int CNick::GetCommonChans(vector<CChan*>& vRetChans, CUser* pUser) cons
|
||||
|
||||
for (unsigned int a = 0; a < vChans.size(); a++) {
|
||||
CChan* pChan = vChans[a];
|
||||
const map<CString,CNick*>& msNicks = pChan->GetNicks();
|
||||
const map<CString,CNick>& msNicks = pChan->GetNicks();
|
||||
|
||||
for (map<CString,CNick*>::const_iterator it = msNicks.begin(); it != msNicks.end(); ++it) {
|
||||
for (map<CString,CNick>::const_iterator it = msNicks.begin(); it != msNicks.end(); ++it) {
|
||||
if (it->first.Equals(m_sNick)) {
|
||||
vRetChans.push_back(pChan);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user