]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdmaptool.cc: : use empty() instead of 'size() < 1'
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 14:34:05 +0000 (15:34 +0100)
committerGreg Farnum <greg@inktank.com>
Thu, 14 Feb 2013 18:26:22 +0000 (10:26 -0800)
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().

This way the code is more logical.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/osdmaptool.cc

index 6df7eb038c313414094ba57f2e49f6881c890dfd..66feeb94d8149924b7c30e8a12259f9015574586 100644 (file)
@@ -120,7 +120,7 @@ int main(int argc, const char **argv)
       ++i;
     }
   }
-  if (args.size() < 1) {
+  if (args.empty()) {
     cerr << me << ": must specify osdmap filename" << std::endl;
     usage();
   }