From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 14:57:45 +0000 (+0100) Subject: rgw/rgw_gc.cc: use !empty() instead of size() to check for emptiness X-Git-Tag: v0.58~66^2~35 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=59f8c8d8ec8a24e6b379ff3702aa600aba9ee39c;p=ceph.git rgw/rgw_gc.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/rgw/rgw_gc.cc b/src/rgw/rgw_gc.cc index d7861e61250e..11d7f0e38def 100644 --- a/src/rgw/rgw_gc.cc +++ b/src/rgw/rgw_gc.cc @@ -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;