replace push_back by emplace_back where possible

This commit is contained in:
Konstantinos Margaritis
2021-03-26 12:39:40 +02:00
parent 1cdb7312cb
commit 3f35a2be37
92 changed files with 535 additions and 535 deletions

View File

@@ -56,7 +56,7 @@ void wireStartToTops(NGHolder &g, const flat_set<NFAVertex> &tops,
assert(!isLeafNode(v, g));
const NFAEdge &e = add_edge(g.start, v, g);
tempEdges.push_back(e);
tempEdges.emplace_back(e);
}
}
@@ -109,10 +109,10 @@ void getStateOrdering(NGHolder &g, const flat_set<NFAVertex> &tops,
temp.erase(remove(temp.begin(), temp.end(), g.startDs));
temp.erase(remove(temp.begin(), temp.end(), g.start));
if (proper_out_degree(g.startDs, g)) {
temp.push_back(g.startDs);
temp.emplace_back(g.startDs);
}
if (!startIsRedundant(g)) {
temp.push_back(g.start);
temp.emplace_back(g.start);
}
// Walk ordering, remove vertices that shouldn't be participating in state
@@ -122,7 +122,7 @@ void getStateOrdering(NGHolder &g, const flat_set<NFAVertex> &tops,
continue; // accepts don't need states
}
ordering.push_back(v);
ordering.emplace_back(v);
}
// Output of topo order was in reverse.
@@ -167,7 +167,7 @@ void optimiseTightLoops(const NGHolder &g, vector<NFAVertex> &ordering) {
continue;
}
if (edge(t, v, g).second && find(start, it, t) != ite) {
candidates.push_back(make_pair(v, t));
candidates.emplace_back(make_pair(v, t));
}
}
}