From: Danny Al-Gaaf Date: Tue, 12 Feb 2013 16:41:04 +0000 (+0100) Subject: mds/MDSMap.h: use up.empty() instead of up.size() X-Git-Tag: v0.58~54^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=49028367dbecd02a203d51bba4c60398d3830ca6;p=ceph.git mds/MDSMap.h: use up.empty() instead of up.size() 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 --- diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index ef0ac194cebb..64f10afd6f49 100644 --- a/src/mds/MDSMap.h +++ b/src/mds/MDSMap.h @@ -455,7 +455,7 @@ public: failed.empty(); } bool is_stopped() { - return up.size() == 0; + return up.empty(); } // inst