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

    r10765 r10821  
    9494
    9595        // Iterate through all players possessing this Quest.
    96         for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    97             QuestEffect::invokeEffects(*it, this->getFailEffectList());
     96        for(const auto & elem : players_)
     97            QuestEffect::invokeEffects(elem, this->getFailEffectList());
    9898
    9999        return true;
     
    119119
    120120        // Iterate through all players possessing the Quest.
    121         for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    122             QuestEffect::invokeEffects(*it, this->getCompleteEffectList());
     121        for(const auto & elem : players_)
     122            QuestEffect::invokeEffects(elem, this->getCompleteEffectList());
    123123
    124124        Quest::complete(player);
     
    242242    {
    243243        int i = index;
    244         for (std::list<QuestEffect*>::const_iterator effect = this->rewards_.begin(); effect != this->rewards_.end(); ++effect)
     244        for (const auto & elem : this->rewards_)
    245245        {
    246246            if(i == 0)
    247                return *effect;
     247               return elem;
    248248
    249249            i--;
Note: See TracChangeset for help on using the changeset viewer.