Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2015, 7:05:53 PM (9 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
Location:
code/branches/cpp11_v2/src/orxonox/items
Files:
2 edited

Legend:

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

    r10768 r10821  
    219219    {
    220220        unsigned int i = 0;
    221         for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
     221        for (const auto & elem : this->effectContainers_)
    222222        {
    223223            if (i == index)
    224                 return (*it);
     224                return (elem);
     225            i++;
    225226        }
    226227        return nullptr;
  • code/branches/cpp11_v2/src/orxonox/items/ShipPart.cc

    r10765 r10821  
    148148    bool ShipPart::hasEntity(StaticEntity* entity) const
    149149    {
    150         for(unsigned int i = 0; i < this->entityList_.size(); i++)
    151         {
    152             if(this->entityList_[i] == entity)
     150        for(auto & elem : this->entityList_)
     151        {
     152            if(elem == entity)
    153153                return true;
    154154        }
Note: See TracChangeset for help on using the changeset viewer.