]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/ObjectMap/KeyValueDBMemory.cc: use empty() instead of size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sun, 11 May 2014 21:13:00 +0000 (23:13 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sun, 11 May 2014 21:13:00 +0000 (23:13 +0200)
Use empty() instead of 'size() == 0' to fix:

[src/test/ObjectMap/KeyValueDBMemory.cc:83]: (performance)
 Possible inefficient checking for 'db' emptiness.
[src/test/ObjectMap/KeyValueDBMemory.cc:97]: (performance)
 Possible inefficient checking for 'db' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/test/ObjectMap/KeyValueDBMemory.cc

index c03e16968a5cf4c8b47be08cfc49bb7d414d7fc6..8883b95ee317de81e01d5d1a48ae859da80208ac 100644 (file)
@@ -80,7 +80,7 @@ public:
 
   int lower_bound(const string &prefix, const string &to) {
     it = db->db.lower_bound(make_pair(prefix,to));
-    if ((db->db.size() == 0) || (it == db->db.end())) {
+    if ((db->db.empty()) || (it == db->db.end())) {
       it = db->db.end();
       ready = false;
       return 0;
@@ -94,7 +94,7 @@ public:
 
   int upper_bound(const string &prefix, const string &after) {
     it = db->db.upper_bound(make_pair(prefix,after));
-    if ((db->db.size() == 0) || (it == db->db.end())) {
+    if ((db->db.empty()) || (it == db->db.end())) {
       it = db->db.end();
       ready = false;
       return 0;