]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Monitor.h: use empty() instead of !size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 25 Feb 2013 16:08:14 +0000 (17:08 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 26 Feb 2013 10:01:42 +0000 (11:01 +0100)
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 <danny.al-gaaf@bisect.de>
src/mon/Monitor.h

index aae43bb603ef921a9d12a572327466fbf21d48eb..8927227eb9b479829ed1a24f18f00bc1edfc2d6e 100644 (file)
@@ -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;
     }