From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 13:34:26 +0000 (+0100) Subject: MonCaps.cc: use !empty() instead of size() X-Git-Tag: v0.58~66^2~55 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f7078b4ae35ded543f9fbedd60c7559d6a5ebc3a;p=ceph.git MonCaps.cc: use !empty() instead of 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(). Signed-off-by: Danny Al-Gaaf --- diff --git a/src/mon/MonCaps.cc b/src/mon/MonCaps.cc index 3c5be9278a3..dc3d9bdd0de 100644 --- a/src/mon/MonCaps.cc +++ b/src/mon/MonCaps.cc @@ -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::iterator i = services_list.begin(); i != services_list.end(); ++i) { MonCap& cap = services_map[*i];