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/questsystem/effects/AddReward.cc

    r10765 r10821  
    8484    {
    8585        int i = index;
    86         for (std::list<Rewardable*>::const_iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward)
     86        for (const auto & elem : this->rewards_)
    8787        {
    8888            if(i == 0)
    89                return *reward;
     89               return elem;
    9090            i--;
    9191        }
     
    106106
    107107        bool temp = true;
    108         for ( std::list<Rewardable*>::iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward )
    109             temp = temp && (*reward)->reward(player);
     108        for (auto & elem : this->rewards_)
     109            temp = temp && (elem)->reward(player);
    110110
    111111        orxout(verbose, context::quests) << "Rewardable successfully added to player." << player << " ." << endl;
Note: See TracChangeset for help on using the changeset viewer.