Minor optimisation for adding overlap edges

It's a big complexity improvement, but only shaves 0.2s off a 0.8s time with 400 plugins on my PC.
This commit is contained in:
Oliver Hamlet
2019-06-23 15:13:18 +01:00
parent 6e0c5f99cb
commit 75e9dc0eb5
+7 -4
View File
@@ -619,8 +619,10 @@ void PluginSorter::AddGroupEdges() {
}
void PluginSorter::AddOverlapEdges() {
for (const auto& vertex :
boost::make_iterator_range(boost::vertices(graph_))) {
vertex_it vit, vitend;
for (tie(vit, vitend) = boost::vertices(graph_); vit != vitend; ++vit) {
vertex_t vertex = *vit;
if (graph_[vertex].NumOverrideFormIDs() == 0) {
if (logger_) {
logger_->trace(
@@ -631,8 +633,9 @@ void PluginSorter::AddOverlapEdges() {
continue;
}
for (const auto& otherVertex :
boost::make_iterator_range(boost::vertices(graph_))) {
for (vertex_it vit2 = std::next(vit); vit2 != vitend; ++vit2) {
vertex_t otherVertex = *vit2;
if (vertex == otherVertex ||
boost::edge(vertex, otherVertex, graph_).second ||
boost::edge(otherVertex, vertex, graph_).second ||