From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 12:56:48 +0000 (+0100) Subject: AuthMonitor.cc: use !pending_auth.empty() instead of 'size() > 0' X-Git-Tag: v0.58~66^2~57 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=180cae5e0b586e3ed33e28ddd93f99aab448d0cf;p=ceph.git AuthMonitor.cc: use !pending_auth.empty() instead of 'size() > 0' 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 --- diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index e4cd752f29b..ac54064d568 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -207,7 +207,7 @@ void AuthMonitor::increase_max_global_id() bool AuthMonitor::should_propose(double& delay) { - return (pending_auth.size() > 0); + return (!pending_auth.empty()); } void AuthMonitor::create_pending()