From a2d842f97b526ec0e7a05495c823166e691b134e Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 26 Feb 2013 11:16:56 +0100 Subject: [PATCH] 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 --- src/os/FileStore.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index de602a9d71a9c..d487ba05d8e19 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) { -- 2.39.5