]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
LFNIndex.cc: use !holes.empty() instead of 'size() > 0'
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 13:59:53 +0000 (14:59 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 13:59:53 +0000 (14:59 +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/LFNIndex.cc

index 1aae19b3a15e8204d6381f59f21b0d4e06375266..412100fe60420d27aa11801ba018b26aa676004e 100644 (file)
@@ -235,7 +235,7 @@ int LFNIndex::remove_objects(const vector<string> &dir,
                                             candidate->second.second));
       candidate++;
     }
-    if (holes.size() > 0)
+    if (!holes.empty())
       clean_chains.insert(lfn_get_short_name(to_clean->second, 0));
   }
   return 0;