]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
HashIndex.cc: use empty() instead of size() to check for emptiness
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 13:58:45 +0000 (14:58 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 13:58:45 +0000 (14:58 +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().

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

index d0d155c8d18d2cff68b8046e7ecdcbddd4112fb5..a1d369d8e509f705d6ec57ef7a0bcf29ad2614c4 100644 (file)
@@ -346,7 +346,7 @@ int HashIndex::recursive_remove(const vector<string> &path) {
   r = list_objects(path, 0, 0, &objects);
   if (r < 0)
     return r;
-  if (objects.size())
+  if (!objects.empty())
     return -ENOTEMPTY;
   vector<string> subdir(path);
   for (set<string>::iterator i = subdirs.begin();