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/modules/gametypes/RaceCheckPoint.cc

    r10765 r10821  
    146146    {
    147147        Vector3 checkpoints(-1,-1,-1); int count=0;
    148         for (std::set<int>::iterator it= nextCheckpoints_.begin();it!=nextCheckpoints_.end(); it++ )
     148        for (const auto & elem : nextCheckpoints_)
    149149        {
    150150            switch (count)
    151151            {
    152                 case 0: checkpoints.x = static_cast<Ogre::Real>(*it); break;
    153                 case 1: checkpoints.y = static_cast<Ogre::Real>(*it); break;
    154                 case 2: checkpoints.z = static_cast<Ogre::Real>(*it); break;
     152                case 0: checkpoints.x = static_cast<Ogre::Real>(elem); break;
     153                case 1: checkpoints.y = static_cast<Ogre::Real>(elem); break;
     154                case 2: checkpoints.z = static_cast<Ogre::Real>(elem); break;
    155155            }
    156156            ++count;
Note: See TracChangeset for help on using the changeset viewer.