tagStateCmp use +exceptionStateLess
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
9870b14640
commit
ab39366f7b
|
|
@ -667,6 +667,10 @@ private:
|
|||
int index_;
|
||||
};
|
||||
|
||||
bool
|
||||
exceptionStateLess(const ExceptionState *state1,
|
||||
const ExceptionState *state2);
|
||||
|
||||
// Exception thrown by check.
|
||||
class EmptyExpceptionPt : public Exception
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2280,17 +2280,23 @@ ExceptionState::hash() const
|
|||
}
|
||||
|
||||
bool
|
||||
ExceptionStateLess::operator()(const ExceptionState *state1,
|
||||
const ExceptionState *state2) const
|
||||
exceptionStateLess(const ExceptionState *state1,
|
||||
const ExceptionState *state2)
|
||||
{
|
||||
const ExceptionPath *except1 = state1->exception();
|
||||
const ExceptionPath *except2 = state2->exception();
|
||||
return except1->id() < except2->id()
|
||||
//return except1 < except2
|
||||
return except1->id() < except2->id()
|
||||
|| (except1 == except2
|
||||
&& state1->index() < state2->index());
|
||||
}
|
||||
|
||||
bool
|
||||
ExceptionStateLess::operator()(const ExceptionState *state1,
|
||||
const ExceptionState *state2) const
|
||||
{
|
||||
return exceptionStateLess(state1, state2);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
ExceptionPathLess::ExceptionPathLess(const Network *network) :
|
||||
|
|
|
|||
|
|
@ -571,9 +571,9 @@ tagStateCmp(const Tag *tag1,
|
|||
&& state_iter2.hasNext()) {
|
||||
ExceptionState *state1 = state_iter1.next();
|
||||
ExceptionState *state2 = state_iter2.next();
|
||||
if (state1 < state2)
|
||||
if (exceptionStateLess(state1, state2))
|
||||
return -1;
|
||||
if (state1 > state2)
|
||||
if (exceptionStateLess(state2, state1))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue