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/Level.cc

    r10818 r10821  
    106106    void Level::networkCallbackTemplatesChanged()
    107107    {
    108         for( std::set<std::string>::iterator it = this->networkTemplateNames_.begin(); it!=this->networkTemplateNames_.end(); ++it )
    109         {
    110             assert(Template::getTemplate(*it));
    111             Template::getTemplate(*it)->applyOn(this);
     108        for(const auto & elem : this->networkTemplateNames_)
     109        {
     110            assert(Template::getTemplate(elem));
     111            Template::getTemplate(elem)->applyOn(this);
    112112        }
    113113    }
     
    135135        //       objects alive when ~Level is called. This is the reason why we cannot directly destroy() the Plugins - instead we need
    136136        //       to call destroyLater() to ensure that no instances from this plugin exist anymore.
    137         for (std::list<PluginReference*>::iterator it = this->plugins_.begin(); it != this->plugins_.end(); ++it)
    138             (*it)->destroyLater();
     137        for (auto & elem : this->plugins_)
     138            (elem)->destroyLater();
    139139        this->plugins_.clear();
    140140    }
     
    173173    {
    174174        unsigned int i = 0;
    175         for (std::list<BaseObject*>::const_iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
     175        for (const auto & elem : this->objects_)
    176176        {
    177177            if (i == index)
    178                 return (*it);
     178                return (elem);
    179179            ++i;
    180180        }
Note: See TracChangeset for help on using the changeset viewer.