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

    r10765 r10821  
    190190
    191191        // Iterate through all subquests.
    192         for (std::list<Quest*>::const_iterator subQuest = this->subQuests_.begin(); subQuest != this->subQuests_.end(); ++subQuest)
     192        for (const auto & elem : this->subQuests_)
    193193        {
    194194            if(i == 0) // We're counting down...
    195                return *subQuest;
     195               return elem;
    196196
    197197            i--;
     
    214214
    215215        // Iterate through all QuestHints.
    216         for (std::list<QuestHint*>::const_iterator hint = this->hints_.begin(); hint != this->hints_.end(); ++hint)
     216        for (const auto & elem : this->hints_)
    217217        {
    218218            if(i == 0) // We're counting down...
    219                return *hint;
     219               return elem;
    220220
    221221            i--;
     
    237237
    238238        // Iterate through all fail QuestEffects.
    239         for (std::list<QuestEffect*>::const_iterator effect = this->failEffects_.begin(); effect != this->failEffects_.end(); ++effect)
     239        for (const auto & elem : this->failEffects_)
    240240        {
    241241            if(i == 0) // We're counting down...
    242                return *effect;
     242               return elem;
    243243
    244244            i--;
     
    260260
    261261        // Iterate through all complete QuestEffects.
    262         for (std::list<QuestEffect*>::const_iterator effect = this->completeEffects_.begin(); effect != this->completeEffects_.end(); ++effect)
     262        for (const auto & elem : this->completeEffects_)
    263263        {
    264264            if(i == 0) // We're counting down...
    265                return *effect;
     265               return elem;
    266266
    267267            i--;
Note: See TracChangeset for help on using the changeset viewer.