tagStateCmp use +exceptionStateLess

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2025-09-12 09:10:03 -07:00
parent 9870b14640
commit ab39366f7b
3 changed files with 16 additions and 6 deletions

View File

@ -667,6 +667,10 @@ private:
int index_;
};
bool
exceptionStateLess(const ExceptionState *state1,
const ExceptionState *state2);
// Exception thrown by check.
class EmptyExpceptionPt : public Exception
{

View File

@ -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) :

View File

@ -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;