]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/WorkQueue.cc: use !empty() instead of size() to check for emptiness
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 15:57:29 +0000 (16:57 +0100)
committerGreg Farnum <greg@inktank.com>
Thu, 14 Feb 2013 18:27:38 +0000 (10:27 -0800)
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 <danny.al-gaaf@bisect.de>
src/common/WorkQueue.cc

index a7efcc02870d101570753136b966370773d7455e..66ce6dc2d15735df96755b2faf035a32f2c67b45 100644 (file)
@@ -99,7 +99,7 @@ void ThreadPool::worker(WorkThread *wt)
       break;
     }
 
-    if (!_pause && work_queues.size()) {
+    if (!_pause && !work_queues.empty()) {
       WorkQueue_* wq;
       int tries = work_queues.size();
       bool did = false;