From 14716fd24bb695975636bcce6afa51c563242bf4 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Mon, 25 Feb 2013 17:08:14 +0100 Subject: [PATCH] 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 --- src/mon/Monitor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index aae43bb603e..8927227eb9b 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; } -- 2.47.3