]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/test/osd/RadosModel.h: use empty() to check for emptiness
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 18:09:40 +0000 (19:09 +0100)
committerGreg Farnum <greg@inktank.com>
Thu, 14 Feb 2013 18:27:40 +0000 (10:27 -0800)
Use empty() instead of size() to check for emptiness for
performance reasons.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/test/osd/RadosModel.h

index 21112d1067fdf7fd218995afa464a7cda4e3975b..be9ff4bccd6bb34a246d4b29c6b0dfe48c97f9e3 100644 (file)
@@ -215,7 +215,7 @@ public:
     state_lock.Lock();
 
     TestOp *next = gen->next(*this);
-    while (next || inflight.size()) {
+    while (next || !inflight.empty()) {
       if (next) {
        inflight.push_back(next);
       }
@@ -235,7 +235,7 @@ public:
          }
        }
        
-       if (inflight.size() >= (unsigned) max_in_flight || (!next && inflight.size())) {
+       if (inflight.size() >= (unsigned) max_in_flight || (!next && !inflight.empty())) {
          cout << "Waiting on " << inflight.size() << std::endl;
          wait();
        } else {
@@ -499,7 +499,7 @@ public:
            op.rmxattr(i->first.c_str());
          }
        }
-       if (!to_remove.size()) {
+       if (to_remove.empty()) {
          context->kick();
          context->oid_in_use.erase(oid);
          context->oid_not_in_use.insert(oid);