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

index de602a9d71a9c8859e3e64da8c1b8a72f25d1d4b..d487ba05d8e19c4df8e3efa74c42dfeb15de515e 100644 (file)
@@ -3899,7 +3899,7 @@ int FileStore::_setattrs(coll_t cid, const hobject_t& oid, map<string,bufferptr>
   if (r < 0)
     return r;
 
-  if (omap_remove.size()) {
+  if (!omap_remove.empty()) {
     assert(g_conf->filestore_xattr_use_omap);
     r = object_map->remove_xattrs(oid, omap_remove, &spos);
     if (r < 0 && r != -ENOENT) {
@@ -3909,7 +3909,7 @@ int FileStore::_setattrs(coll_t cid, const hobject_t& oid, map<string,bufferptr>
     }
   }
   
-  if (omap_set.size()) {
+  if (!omap_set.empty()) {
     assert(g_conf->filestore_xattr_use_omap);
     r = object_map->set_xattrs(oid, omap_set, &spos);
     if (r < 0) {