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/network/Server.cc

    r10768 r10919  
    232232  {
    233233    std::vector<packet::Gamestate*> gamestates = GamestateManager::getGamestates();
    234     std::vector<packet::Gamestate*>::iterator it;
    235     for( it = gamestates.begin(); it != gamestates.end(); ++it )
     234    for( packet::Gamestate* gamestate : gamestates )
    236235    {
    237       (*it)->send(static_cast<Host*>(this));
     236      gamestate->send(static_cast<Host*>(this));
    238237    }
    239238    return true;
     
    434433      return true;
    435434
    436     std::vector<uint32_t>::iterator it;
    437     for( it=this->clientIDs_.begin(); it!=this->clientIDs_.end(); ++it )
    438       if( *it == targetID )
     435    for( uint32_t id : this->clientIDs_ )
     436      if( id == targetID )
    439437        return true;
    440438
Note: See TracChangeset for help on using the changeset viewer.