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/objects/triggers/Trigger.cc

    r10624 r10821  
    234234    {
    235235        // Iterate over all sub-triggers.
    236         for (std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)
    237         {
    238             if (!(*it)->isActive())
     236        for (const auto & elem : this->children_)
     237        {
     238            if (!(elem)->isActive())
    239239                return false;
    240240        }
     
    252252    {
    253253        // Iterate over all sub-triggers.
    254         for (std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)
    255         {
    256             if ((*it)->isActive())
     254        for (const auto & elem : this->children_)
     255        {
     256            if ((elem)->isActive())
    257257                return true;
    258258        }
     
    270270    {
    271271        bool test = false;
    272         for (std::set<TriggerBase*>::iterator it = this->children_.begin(); it != this->children_.end(); ++it)
    273         {
    274             if (test && (*it)->isActive())
     272        for (const auto & elem : this->children_)
     273        {
     274            if (test && (elem)->isActive())
    275275                return false;
    276             if ((*it)->isActive())
     276            if ((elem)->isActive())
    277277                test = true;
    278278        }
Note: See TracChangeset for help on using the changeset viewer.