Changeset 10873 for trunk/FACT++/src


Ignore:
Timestamp:
05/27/11 16:30:07 (13 years ago)
Author:
tbretz
Message:
Replaced a self-done loop by std::find; changed some comments.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/StateMachineDim.cc

    r10510 r10873  
    167167    const EventImp *evt = dynamic_cast<EventImp*>(cmd);
    168168
    169     // FIXME: In the case of HandleEvent there is no need to copy the data
    170     // FIMXE: Currentyl the time is not copied
    171     // FIXME: Handle Event is not thread safe (Dim + Console)
    172169    if (HasEvent(evt))
    173170        PostEvent(*evt);
  • trunk/FACT++/src/StateMachineImp.cc

    r10780 r10873  
    316316        // FIXME: Is this thread safe? (Yes, because the data is copied)
    317317        // But two handlers could be called at the same time. Do we
    318         // need to lock the handlers?
     318        // need to lock the handlers? (Dim + console)
     319        // FIXME: Is copying of the data necessary?
    319320        const Event event(evt, ptr, siz);
    320321        HandleEvent(event);
     
    456457{
    457458    // Find the event from the list of commands and queue it
    458     for (vector<EventImp*>::const_iterator c=fListOfEvents.begin(); c!=fListOfEvents.end(); c++)
    459         if (*c == cmd)
    460             return true;
    461 
    462     return false;
     459    return find(fListOfEvents.begin(), fListOfEvents.end(), cmd)!=fListOfEvents.end();
    463460}
    464461
Note: See TracChangeset for help on using the changeset viewer.