Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2015, 7:05:53 PM (9 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/overlays/stats/Scoreboard.cc

    r9667 r10821  
    6060        SUPER(Scoreboard, changedVisibility);
    6161
    62         for (unsigned int i = 0; i < this->lines_.size(); ++i)
    63             this->lines_[i]->changedVisibility();
     62        for (auto & elem : this->lines_)
     63            elem->changedVisibility();
    6464    }
    6565
     
    9494
    9595        unsigned int index = 0;
    96         for (std::map<PlayerInfo*, Player>::const_iterator it = playerList.begin(); it != playerList.end(); ++it)
     96        for (const auto & elem : playerList)
    9797        {
    98             this->lines_[index]->setPlayerName(multi_cast<std::string>(it->first->getName()));
    99             this->lines_[index]->setScore(multi_cast<std::string>(it->second.frags_));
    100             this->lines_[index]->setDeaths(multi_cast<std::string>(it->second.killed_));
     98            this->lines_[index]->setPlayerName(multi_cast<std::string>(elem.first->getName()));
     99            this->lines_[index]->setScore(multi_cast<std::string>(elem.second.frags_));
     100            this->lines_[index]->setDeaths(multi_cast<std::string>(elem.second.killed_));
    101101            index++;
    102102        }
Note: See TracChangeset for help on using the changeset viewer.