]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
MonCaps.cc: use !empty() instead of size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 13:34:26 +0000 (14:34 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 13:34:26 +0000 (14:34 +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/MonCaps.cc

index 3c5be9278a333d6c82c28994728deab379d34a06..dc3d9bdd0de182a5ca4600dbe0ed118d4e24f73b 100644 (file)
@@ -213,8 +213,7 @@ do { \
 
         if (token.compare(";") == 0 || pos >= s.size()) {
          if (got_eq) {
-            ASSERT_STATE((services_list.size() > 0) ||
-                        (uid_list.size() > 0));
+            ASSERT_STATE(!services_list.empty() || !uid_list.empty());
             
             for (list<int>::iterator i = services_list.begin(); i != services_list.end(); ++i) {
               MonCap& cap = services_map[*i];