]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG.cc: use empty() instead of size() == 0
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 26 Feb 2013 10:19:25 +0000 (11:19 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 26 Feb 2013 10:19:25 +0000 (11:19 +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/osd/ReplicatedPG.cc

index cfa6bbabe8a0bb4761e09a5b2d6d4b2c25f19bfb..b45fb96329605c8e45a722343f751d461c1173b0 100644 (file)
@@ -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<pair<uint64_t, entity_name_t>, watch_info_t>::iterator p =