src/simulator/scheduler-map.cc
changeset 196 9d243651d00c
parent 194 882aa1fc50fd
child 231 8516b1203fbd
equal deleted inserted replaced
195:c4a63ac2c5de 196:9d243651d00c
    47  * - irreflexibility: f (x,x) is false)
    47  * - irreflexibility: f (x,x) is false)
    48  * - antisymmetry: f(x,y) = !f(y,x)
    48  * - antisymmetry: f(x,y) = !f(y,x)
    49  * - transitivity: f(x,y) and f(y,z) => f(x,z)
    49  * - transitivity: f(x,y) and f(y,z) => f(x,z)
    50  */
    50  */
    51 bool
    51 bool
    52 SchedulerMap::EventKeyCompare::operator () (struct EventKey a, struct EventKey b)
    52 SchedulerMap::EventKeyCompare::operator () (struct EventKey const&a, struct EventKey const&b)
    53 {
    53 {
    54   if (a.m_ns < b.m_ns) 
    54   if (a.m_ns < b.m_ns) 
    55     {
    55     {
    56       return true;
    56       return true;
    57     } 
    57     } 
    58   else if (a.m_ns == b.m_ns && a.m_uid < b.m_uid) 
    58   else if (a.m_ns > b.m_ns)
       
    59     {
       
    60       return false;
       
    61     } 
       
    62   else if (a.m_uid < b.m_uid)
    59     {
    63     {
    60       return true;
    64       return true;
    61     } 
    65     }
    62   else 
    66   else 
    63     {
    67     {
    64       return false;
    68       return false;
    65     }
    69     }
    66 }
    70 }