From: Danny Al-Gaaf Date: Mon, 25 Feb 2013 16:08:14 +0000 (+0100) Subject: Monitor.h: use empty() instead of !size() X-Git-Tag: v0.59~111^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14716fd24bb695975636bcce6afa51c563242bf4;p=ceph.git Monitor.h: use empty() instead of !size() 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(). Signed-off-by: Danny Al-Gaaf --- diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index aae43bb603ef..8927227eb9b4 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -352,7 +352,7 @@ private: // we have disabled it in the past. It doesn't mean we are going to // do anything about it, but if we happen to become the leader // sometime down the future, we sure want to have the trim enabled. - if (!mon->trim_timeouts.size()) + if (mon->trim_timeouts.empty()) mon->paxos->trim_enable(); mon->trim_enable_timer = NULL; }