diff --git a/search/Path.cc b/search/Path.cc index 3e5763b0..0a224d6e 100644 --- a/search/Path.cc +++ b/search/Path.cc @@ -247,13 +247,14 @@ Path::equal(const Path *path1, const Path *path2, const StaState *sta) { - return (path1 - && path2 - && path1->vertexId(sta) == path2->vertexId(sta) - // Tag equal implies transition and path ap equal. - && path1->tagIndex(sta) == path2->tagIndex(sta)) - || ((path1 == nullptr || path1->isNull()) - && (path2 == nullptr || path2->isNull())); + bool path1_null = (path1 == nullptr || path1->isNull()); + bool path2_null = (path2 == nullptr || path2->isNull()); + return (path1_null && path2_null) + || (!path1_null + && !path2_null + && path1->vertexId(sta) == path2->vertexId(sta) + // Tag equal implies transition and path ap equal. + && path1->tagIndex(sta) == path2->tagIndex(sta)); } //////////////////////////////////////////////////////////////// diff --git a/search/PathEnd.cc b/search/PathEnd.cc index ad633b9c..aea78dc5 100644 --- a/search/PathEnd.cc +++ b/search/PathEnd.cc @@ -1962,21 +1962,11 @@ PathEnd::cmp(const PathEnd *path_end1, if (cmp == 0) { cmp = clkEdgeCmp(path_end1->targetClkEdge(sta), path_end2->targetClkEdge(sta)); - if (cmp == 0) { - PathExpanded expanded1(path1, sta); - PathExpanded expanded2(path2, sta); - const Path *start1 = expanded1.startPath(); - const Path *start2 = expanded2.startPath(); - return Path::cmp(start1, start2, sta) < 0; - } - else - return cmp; + if (cmp == 0) + return Path::cmpAll(path1, path2, sta); } - else - return cmp; } - else - return cmp; + return cmp; } int