Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2015, 7:05:53 PM (8 years ago)
Author:
muemart
Message:

Run clang-modernize -loop-convert

  • Again, not all possible loops were converted
  • It can do pretty cool transformations, but I had to fix a few compile errors, so there might be some runtime errors lurking around too
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/orxonox/Scene.cc

    r10768 r10821  
    220220        {
    221221            // Remove all WorldEntities and shove them to the queue since they would still like to be in a physical world.
    222             for (std::set<WorldEntity*>::const_iterator it = this->physicalObjects_.begin();
    223                 it != this->physicalObjects_.end(); ++it)
     222            for (const auto & elem : this->physicalObjects_)
    224223            {
    225                 this->physicalWorld_->removeRigidBody((*it)->physicalBody_);
    226                 this->physicalObjectQueue_.insert(*it);
     224                this->physicalWorld_->removeRigidBody((elem)->physicalBody_);
     225                this->physicalObjectQueue_.insert(elem);
    227226            }
    228227            this->physicalObjects_.clear();
     
    256255            {
    257256                // Add all scheduled WorldEntities
    258                 for (std::set<WorldEntity*>::const_iterator it = this->physicalObjectQueue_.begin();
    259                     it != this->physicalObjectQueue_.end(); ++it)
     257                for (const auto & elem : this->physicalObjectQueue_)
    260258                {
    261                     this->physicalWorld_->addRigidBody((*it)->physicalBody_);
    262                     this->physicalObjects_.insert(*it);
     259                    this->physicalWorld_->addRigidBody((elem)->physicalBody_);
     260                    this->physicalObjects_.insert(elem);
    263261                }
    264262                this->physicalObjectQueue_.clear();
     
    321319    {
    322320        unsigned int i = 0;
    323         for (std::list<BaseObject*>::const_iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
     321        for (const auto & elem : this->objects_)
    324322        {
    325323            if (i == index)
    326                 return (*it);
     324                return (elem);
    327325            ++i;
    328326        }
Note: See TracChangeset for help on using the changeset viewer.