mirror of
https://github.com/znc/znc.git
synced 2026-07-05 17:31:06 +02:00
Use empty() instead of size() == 0 where appropriate
This was found by cppcheck (cppcheck.sf.net). git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1761 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -733,7 +733,7 @@ CChan* CUser::FindChan(const CString& sName) const {
|
||||
|
||||
void CUser::JoinChans() {
|
||||
// Avoid divsion by zero, it's bad!
|
||||
if (m_vChans.size() == 0)
|
||||
if (m_vChans.empty())
|
||||
return;
|
||||
|
||||
// We start at a random offset into the channel list so that if your
|
||||
@@ -962,7 +962,7 @@ CString CUser::GetLocalIP() {
|
||||
return pIRCSock->GetLocalIP();
|
||||
}
|
||||
|
||||
if (m_vClients.size()) {
|
||||
if (!m_vClients.empty()) {
|
||||
return m_vClients[0]->GetLocalIP();
|
||||
}
|
||||
|
||||
@@ -1117,7 +1117,7 @@ CString CUser::GetCurNick() const {
|
||||
return pIRCSock->GetNick();
|
||||
}
|
||||
|
||||
if (m_vClients.size()) {
|
||||
if (!m_vClients.empty()) {
|
||||
return m_vClients[0]->GetNick();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user