Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2015, 10:47:51 PM (9 years ago)
Author:
landauf
Message:

use range-based for-loop where it makes sense (e.g. ObjectList)

Location:
code/branches/cpp11_v2/src/modules/objects/eventsystem
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc

    r10916 r10919  
    7070        {
    7171            bool success = false;
    72             for (std::list<EventName*>::const_iterator it = this->names_.begin(); it != this->names_.end(); ++it)
     72            for (EventName* name : this->names_)
    7373            {
    74                 if ((*it)->getName() == event.name_)
     74                if (name->getName() == event.name_)
    7575                {
    7676                    success = true;
  • code/branches/cpp11_v2/src/modules/objects/eventsystem/EventListener.cc

    r9667 r10919  
    7878            return;
    7979
    80         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    81             if (it->getName() == this->eventName_)
    82                 this->addEventSource(*it, "");
     80        for (BaseObject* object : ObjectList<BaseObject>())
     81            if (object->getName() == this->eventName_)
     82                this->addEventSource(object, "");
    8383    }
    8484
  • code/branches/cpp11_v2/src/modules/objects/eventsystem/EventTarget.cc

    r9667 r10919  
    7373        this->target_ = name;
    7474
    75         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    76             if (it->getName() == this->target_)
    77                 this->addEventTarget(*it);
     75        for (BaseObject* object : ObjectList<BaseObject>())
     76            if (object->getName() == this->target_)
     77                this->addEventTarget(object);
    7878    }
    7979
Note: See TracChangeset for help on using the changeset viewer.