From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 17:58:41 +0000 (+0100) Subject: test_object_map.cc: use empty() to check for emptiness X-Git-Tag: v0.58~66^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9da963efda37d8c5077f99f740d3c4a3144036cf;p=ceph.git test_object_map.cc: use empty() to check for emptiness Use !empty() instead of 'size()' to check for emptiness for performance reasons. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/test/ObjectMap/test_object_map.cc b/src/test/ObjectMap/test_object_map.cc index e536be3b8473..e26b0e2c31cf 100644 --- a/src/test/ObjectMap/test_object_map.cc +++ b/src/test/ObjectMap/test_object_map.cc @@ -125,7 +125,7 @@ public: to_get.insert(key); map got; db->get_xattrs(hoid, to_get, &got); - if (got.size()) { + if (!got.empty()) { *value = string(got.begin()->second.c_str(), got.begin()->second.length()); return 1; @@ -145,7 +145,7 @@ public: to_get.insert(key); map got; db->get_values(hoid, to_get, &got); - if (got.size()) { + if (!got.empty()) { *value = string(got.begin()->second.c_str(), got.begin()->second.length()); return 1;