]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_gc.cc: use !empty() instead of size() to check for emptiness
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 14:57:45 +0000 (15:57 +0100)
committerGreg Farnum <greg@inktank.com>
Thu, 14 Feb 2013 18:27:38 +0000 (10:27 -0800)
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/rgw/rgw_gc.cc

index d7861e61250e4529f700c4b1b77678c271ae7569..11d7f0e38def1849f211605bf09c60716edbbc61 100644 (file)
@@ -217,7 +217,7 @@ int RGWGC::process(int index, int max_secs)
   } while (truncated);
 
 done:
-  if (remove_tags.size())
+  if (!remove_tags.empty())
     remove(index, remove_tags);
   l.unlock(&store->gc_pool_ctx, obj_names[index]);
   delete ctx;