Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
warning from cppcheck was:
[src/mon/AuthMonitor.cc:210]: (performance) Possible inefficient
checking for 'pending_auth' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
bool AuthMonitor::should_propose(double& delay)
{
- return (pending_auth.size() > 0);
+ return (!pending_auth.empty());
}
void AuthMonitor::create_pending()