]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ObjectCacher.cc: use empty() instead of !size() to check for emptiness
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 14:24:37 +0000 (15:24 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 14:24:37 +0000 (15:24 +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/osdc/ObjectCacher.cc

index 265a806dbb231c0a6fd63f4615f9e9253452f67d..5ba29a1c79476a0f27eec4a5c0b402a10f13dbd3 100644 (file)
@@ -514,7 +514,7 @@ ObjectCacher::~ObjectCacher()
   for (vector<hash_map<sobject_t, Object *> >::iterator i = objects.begin();
       i != objects.end();
       ++i)
-    assert(!i->size());
+    assert(i->empty());
   assert(bh_lru_rest.lru_get_size() == 0);
   assert(bh_lru_dirty.lru_get_size() == 0);
   assert(ob_lru.lru_get_size() == 0);