Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2015, 10:47:51 PM (9 years ago)
Author:
landauf
Message:

use range-based for-loop where it makes sense (e.g. ObjectList)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/ThreadPool.cc

    r8394 r10919  
    8383    bool ThreadPool::passFunction( const ExecutorPtr& executor, bool addThread )
    8484    {
    85         std::vector<Thread*>::iterator it;
    86         for ( it=this->threadPool_.begin(); it!=this->threadPool_.end(); ++it )
     85        for ( Thread* thread : threadPool_ )
    8786        {
    88             if ( ! (*it)->isWorking() )
     87            if ( ! thread->isWorking() )
    8988            {
    9089                // If that fails, then there is some code error
    91                 OrxVerify( (*it)->evaluateExecutor( executor ), "ERROR: could not evaluate Executor" );
     90                OrxVerify( thread->evaluateExecutor( executor ), "ERROR: could not evaluate Executor" );
    9291                return true;
    9392            }
     
    105104    void ThreadPool::synchronise()
    106105    {
    107         std::vector<Thread*>::iterator it;
    108         for ( it=this->threadPool_.begin(); it!=this->threadPool_.end(); ++it )
     106        for ( Thread* thread : this->threadPool_ )
    109107        {
    110             (*it)->waitUntilFinished();
     108            thread->waitUntilFinished();
    111109        }
    112110    }
Note: See TracChangeset for help on using the changeset viewer.