From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 18:09:40 +0000 (+0100) Subject: src/test/osd/RadosModel.h: use empty() to check for emptiness X-Git-Tag: v0.58~66^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f9bf1275d0ba77184cb2dc6b519c13c60d38d18e;p=ceph.git src/test/osd/RadosModel.h: 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/osd/RadosModel.h b/src/test/osd/RadosModel.h index 21112d1067fd..be9ff4bccd6b 100644 --- a/src/test/osd/RadosModel.h +++ b/src/test/osd/RadosModel.h @@ -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);