From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 13:58:45 +0000 (+0100) Subject: HashIndex.cc: use empty() instead of size() to check for emptiness X-Git-Tag: v0.58~66^2~48 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4893def5690f811e2764c3083a63a6093e09a80e;p=ceph.git HashIndex.cc: use empty() instead of size() to check for emptiness 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/os/HashIndex.cc b/src/os/HashIndex.cc index d0d155c8d18..a1d369d8e50 100644 --- a/src/os/HashIndex.cc +++ b/src/os/HashIndex.cc @@ -346,7 +346,7 @@ int HashIndex::recursive_remove(const vector &path) { r = list_objects(path, 0, 0, &objects); if (r < 0) return r; - if (objects.size()) + if (!objects.empty()) return -ENOTEMPTY; vector subdir(path); for (set::iterator i = subdirs.begin();