From: Danny Al-Gaaf Date: Tue, 26 Feb 2013 10:19:25 +0000 (+0100) Subject: ReplicatedPG.cc: use empty() instead of size() == 0 X-Git-Tag: v0.59~111^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4059d94a52e4d4c1e636e61e10281ec2110b38d5;p=ceph.git ReplicatedPG.cc: use empty() instead of size() == 0 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/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index cfa6bbabe8a0..b45fb9632960 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3989,7 +3989,7 @@ void ReplicatedPG::populate_obc_watchers(ObjectContext *obc) log.objects[obc->obs.oi.soid]->reverting_to == obc->obs.oi.version)); dout(10) << "populate_obc_watchers " << obc->obs.oi.soid << dendl; - assert(obc->watchers.size() == 0); + assert(obc->watchers.empty()); // populate unconnected_watchers utime_t now = ceph_clock_now(g_ceph_context); for (map, watch_info_t>::iterator p =