From: Danny Al-Gaaf Date: Tue, 26 Feb 2013 10:16:56 +0000 (+0100) Subject: FileStore.cc: use if(!empty()) instead of if(size()) X-Git-Tag: v0.59~111^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a2d842f97b526ec0e7a05495c823166e691b134e;p=ceph.git FileStore.cc: use if(!empty()) instead of if(size()) 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/os/FileStore.cc b/src/os/FileStore.cc index de602a9d71a9..d487ba05d8e1 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -3899,7 +3899,7 @@ int FileStore::_setattrs(coll_t cid, const hobject_t& oid, map 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 } } - 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) {