rose build: dedupe hasLastByteHistorySucc func

This commit is contained in:
Justin Viiret 2016-06-14 15:22:07 +10:00 committed by Matthew Barr
parent cf8e8c90ff
commit d3c56b532b

View File

@ -1776,22 +1776,12 @@ u32 addIteratorToTable(build_context &bc,
return offset;
}
static
bool hasLastByteHistoryOutEdge(const RoseGraph &g, RoseVertex v) {
for (const auto &e : out_edges_range(v, g)) {
if (g[e].history == ROSE_ROLE_HISTORY_LAST_BYTE) {
return true;
}
}
return false;
}
static
u32 buildLastByteIter(const RoseGraph &g, build_context &bc) {
vector<u32> lb_roles;
for (auto v : vertices_range(g)) {
if (!hasLastByteHistoryOutEdge(g, v)) {
if (!hasLastByteHistorySucc(g, v)) {
continue;
}
// Eager EOD reporters won't have state indices.