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/worldentities/ControllableEntity.cc

    r10769 r10821  
    165165    {
    166166        unsigned int i = 0;
    167         for (std::list<StrongPtr<CameraPosition>>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     167        for (const auto & elem : this->cameraPositions_)
    168168        {
    169169            if (i == index)
    170                 return (*it);
     170                return (elem);
    171171            ++i;
    172172        }
     
    180180
    181181        unsigned int counter = 0;
    182         for (std::list<StrongPtr<CameraPosition>>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    183         {
    184             if ((*it) == this->currentCameraPosition_)
     182        for (const auto & elem : this->cameraPositions_)
     183        {
     184            if ((elem) == this->currentCameraPosition_)
    185185                break;
    186186            counter++;
     
    477477        if (parent)
    478478        {
    479             for (std::list<StrongPtr<CameraPosition>>::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    480                 if ((*it)->getIsAbsolute())
    481                     parent->attach((*it));
     479            for (auto & elem : this->cameraPositions_)
     480                if ((elem)->getIsAbsolute())
     481                    parent->attach((elem));
    482482        }
    483483    }
Note: See TracChangeset for help on using the changeset viewer.