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/notifications/NotificationQueue.cc

    r9667 r10821  
    206206        {
    207207            // Add all Notifications that have been created after this NotificationQueue was created.
    208             for(std::multimap<std::time_t, Notification*>::iterator it = notifications->begin(); it != notifications->end(); it++)
     208            for(auto & notification : *notifications)
    209209            {
    210                 if(it->first >= this->creationTime_)
    211                     this->push(it->second, it->first);
     210                if(notification.first >= this->creationTime_)
     211                    this->push(notification.second, notification.first);
    212212            }
    213213        }
     
    336336        this->ordering_.clear();
    337337        // Delete all NotificationContainers in the list.
    338         for(std::vector<NotificationContainer*>::iterator it = this->notifications_.begin(); it != this->notifications_.end(); it++)
    339             delete *it;
     338        for(auto & elem : this->notifications_)
     339            delete elem;
    340340
    341341        this->notifications_.clear();
     
    426426        bool first = true;
    427427        // Iterate through the set of targets.
    428         for(std::set<std::string>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); it++)
     428        for(const auto & elem : this->targets_)
    429429        {
    430430            if(!first)
     
    432432            else
    433433                first = false;
    434             stream << *it;
     434            stream << elem;
    435435        }
    436436
Note: See TracChangeset for help on using the changeset viewer.