Avoid unnecessary vertex equality comparison

Just avoid ever comparing a vertex to itself.
This commit is contained in:
Oliver Hamlet
2022-12-31 18:47:11 +00:00
parent a7e0633d6c
commit b02b209835
+3 -2
View File
@@ -576,12 +576,13 @@ void PluginGraph::AddSpecificEdges() {
const auto& vertex = *vit;
const auto& plugin = GetPlugin(vertex);
for (vertex_it vit2 = vit; vit2 != vitend; ++vit2) {
for (vertex_it vit2 = std::next(vit); vit2 != vitend; ++vit2) {
const auto& otherVertex = *vit2;
const auto& otherPlugin = GetPlugin(otherVertex);
if (plugin.IsMaster() == otherPlugin.IsMaster())
if (plugin.IsMaster() == otherPlugin.IsMaster()) {
continue;
}
const auto isOtherPluginAMaster = otherPlugin.IsMaster();
vertex_t childVertex = isOtherPluginAMaster ? vertex : otherVertex;