}
static
-bool setDistinctTops(NGHolder &h1, const NGHolder &h2,
+void setDistinctTops(NGHolder &h1, const NGHolder &h2,
map<u32, u32> &top_mapping) {
flat_set<u32> tops1 = getTops(h1), tops2 = getTops(h2);
// If our tops don't intersect, we're OK to merge with no changes.
if (!has_intersection(tops1, tops2)) {
DEBUG_PRINTF("tops don't intersect\n");
- return true;
+ return ;
}
// Otherwise, we have to renumber the tops in h1 so that they don't overlap
}
replaceTops(h1, top_mapping);
- return true;
+ return ;
}
-bool setDistinctRoseTops(RoseGraph &g, NGHolder &h1, const NGHolder &h2,
+void setDistinctRoseTops(RoseGraph &g, NGHolder &h1, const NGHolder &h2,
const deque<RoseVertex> &verts1) {
map<u32, u32> top_mapping;
setDistinctTops(h1, h2, top_mapping);
if (top_mapping.empty()) {
- return true; // No remapping necessary.
+ return ; // No remapping necessary.
}
for (auto v : verts1) {
}
}
- return true;
+ return ;
}
static
-bool setDistinctSuffixTops(RoseGraph &g, NGHolder &h1, const NGHolder &h2,
+void setDistinctSuffixTops(RoseGraph &g, NGHolder &h1, const NGHolder &h2,
const deque<RoseVertex> &verts1) {
map<u32, u32> top_mapping;
setDistinctTops(h1, h2, top_mapping);
if (top_mapping.empty()) {
- return true; // No remapping necessary.
+ return ; // No remapping necessary.
}
for (auto v : verts1) {
g[v].suffix.top = top_mapping[t];
}
- return true;
+ return ;
}
/** \brief Estimate the number of accel states in the given graph when built as
bool mergeableRoseVertices(const RoseBuildImpl &tbi,
const std::set<RoseVertex> &v1,
const std::set<RoseVertex> &v2);
-bool setDistinctRoseTops(RoseGraph &g, NGHolder &h1, const NGHolder &h2,
+void setDistinctRoseTops(RoseGraph &g, NGHolder &h1, const NGHolder &h2,
const std::deque<RoseVertex> &verts1);
} // namespace ue2
DEBUG_PRINTF("victim %zu states\n", num_vertices(*a_h));
DEBUG_PRINTF("winner %zu states\n", num_vertices(*b_h));
-
- if (!setDistinctRoseTops(g, victim, *b_h, deque<RoseVertex>(1, a))) {
- assert(roseHasTops(build, a));
- assert(roseHasTops(build, b));
- return false;
- }
+ setDistinctRoseTops(g, victim, *b_h, deque<RoseVertex>(1, a));
assert(victim.kind == b_h->kind);
assert(!generates_callbacks(*b_h));