From f8e3e523e27e0a3838c292a560cf6dba9d20d267 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 29 Nov 2016 17:21:47 +0100 Subject: Rewrite some (trivial) assignments inside if/while conditions: comphelper Change-Id: I8361f62199f45dbced45e5d4a4d5eeddf1c42d67 --- comphelper/source/misc/threadpool.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'comphelper') diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx index f399274eed24..346c1712b270 100644 --- a/comphelper/source/misc/threadpool.cxx +++ b/comphelper/source/misc/threadpool.cxx @@ -57,8 +57,7 @@ public: #if defined DBG_UTIL && defined LINUX gbIsWorkerThread = true; #endif - ThreadTask *pTask; - while ( ( pTask = waitForWork() ) ) + while ( ThreadTask * pTask = waitForWork() ) { std::shared_ptr pTag(pTask->getTag()); try { @@ -189,8 +188,7 @@ void ThreadPool::waitAndCleanupWorkers() if( maWorkers.empty() ) { // no threads at all -> execute the work in-line - ThreadTask *pTask; - while ( ( pTask = popWork() ) ) + while ( ThreadTask * pTask = popWork() ) { std::shared_ptr pTag(pTask->getTag()); pTask->doWork(); @@ -269,8 +267,7 @@ void ThreadPool::waitUntilDone(const std::shared_ptr& rTag) if( maWorkers.empty() ) { // no threads at all -> execute the work in-line - ThreadTask *pTask; - while ( ( pTask = popWork() ) ) + while ( ThreadTask * pTask = popWork() ) { std::shared_ptr pTag(pTask->getTag()); pTask->doWork(); -- cgit