]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDSMap.h: use up.empty() instead of up.size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 12 Feb 2013 16:41:04 +0000 (17:41 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 15 Feb 2013 20:55:08 +0000 (21:55 +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().

warning from cppchecker was:
[src/mds/MDSMap.h:448]: (performance) Possible inefficient
  checking for 'up' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mds/MDSMap.h

index ef0ac194cebb236eb710b35789d4db5c35c8743c..64f10afd6f4942f9b087e788b9163cbd72f1e593 100644 (file)
@@ -455,7 +455,7 @@ public:
       failed.empty();
   }
   bool is_stopped() {
-    return up.size() == 0;
+    return up.empty();
   }
 
   // inst