Micro-optimization: Use existing functions in CModule::RemTimer()

CModule::RemTimer(const CString& sLabel) now uses FindTimer() and
RemTimer(CTimer *) to do the work instead of doing all of this by itself.

Thanks to KiNgMaR again.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1651 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-10-17 15:50:58 +00:00
parent 78af088fd7
commit 03f3e348e4

View File

@@ -333,18 +333,10 @@ bool CModule::RemTimer(CTimer* pTimer) {
}
bool CModule::RemTimer(const CString& sLabel) {
set<CTimer*>::iterator it;
for (it = m_sTimers.begin(); it != m_sTimers.end(); ++it) {
CTimer* pTimer = *it;
if (pTimer->GetName().Equals(sLabel)) {
m_sTimers.erase(it);
m_pManager->DelCronByAddr(pTimer);
return true;
}
}
return false;
CTimer *pTimer = FindTimer(sLabel);
if (!pTimer)
return false;
return RemTimer(pTimer);
}
bool CModule::UnlinkTimer(CTimer* pTimer) {