]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon_store_converter.cc: use empty() instead of size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 26 Feb 2013 10:15:35 +0000 (11:15 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 26 Feb 2013 10:15:35 +0000 (11:15 +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_store_converter.cc

index 3d8e53067e8fd16d3d092d6c5534f841d0aa506f..1c0d3af98e2b7285e195f1f9661bae8e09428feb 100644 (file)
@@ -247,7 +247,7 @@ class MonitorStoreConverter {
   }
 
   void _convert_paxos() {
-    assert(gvs.size() > 0);
+    assert(!gvs.empty());
 
     set<version_t>::reverse_iterator rit = gvs.rbegin();
     version_t highest_gv = *rit;
@@ -320,7 +320,7 @@ int main(int argc, const char *argv[])
   common_init_finish(g_ceph_context);
   g_ceph_context->_conf->apply_changes(NULL);
 
-  if (args.size() < 1) {
+  if (args.empty()) {
     usage(our_name);
     return 1;
   }