From 38363c17d5328b255f7f181eb8806702d0895599 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Fri, 2 Dec 2022 14:21:37 +0000 Subject: [PATCH] Remove tie() usage in for loops It's unnecessary since C++17 introduced structured bindings. --- src/api/sorting/plugin_graph.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/api/sorting/plugin_graph.cpp b/src/api/sorting/plugin_graph.cpp index ce67d0ab..05231781 100644 --- a/src/api/sorting/plugin_graph.cpp +++ b/src/api/sorting/plugin_graph.cpp @@ -413,8 +413,7 @@ void PluginGraph::AddHardcodedPluginEdges(Game& game) { continue; } - vertex_it vit, vitend; - for (tie(vit, vitend) = boost::vertices(graph_); vit != vitend; ++vit) { + for (auto [vit, vitend] = boost::vertices(graph_); vit != vitend; ++vit) { if (*vit == pluginVertex.value()) { continue; } @@ -429,8 +428,7 @@ void PluginGraph::AddHardcodedPluginEdges(Game& game) { void PluginGraph::AddSpecificEdges() { // Add edges for all relationships that aren't overlaps. - vertex_it vit, vitend; - for (tie(vit, vitend) = boost::vertices(graph_); vit != vitend; ++vit) { + for (auto [vit, vitend] = boost::vertices(graph_); vit != vitend; ++vit) { for (vertex_it vit2 = vit; vit2 != vitend; ++vit2) { if (graph_[*vit].IsMaster() == graph_[*vit2].IsMaster()) continue; @@ -672,8 +670,7 @@ void PluginGraph::AddGroupEdges( void PluginGraph::AddOverlapEdges() { auto logger = getLogger(); - vertex_it vit, vitend; - for (tie(vit, vitend) = boost::vertices(graph_); vit != vitend; ++vit) { + for (auto [vit, vitend] = boost::vertices(graph_); vit != vitend; ++vit) { vertex_t vertex = *vit; if (graph_[vertex].NumOverrideFormIDs() == 0) { @@ -758,8 +755,7 @@ void PluginGraph::AddTieBreakEdges() { // possible result. This can be enforced by adding edges between all vertices // that aren't already linked. Use existing load order to decide the direction // of these edges. - vertex_it vit, vitend; - for (tie(vit, vitend) = boost::vertices(graph_); vit != vitend; ++vit) { + for (auto [vit, vitend] = boost::vertices(graph_); vit != vitend; ++vit) { vertex_t vertex = *vit; for (vertex_it vit2 = std::next(vit); vit2 != vitend; ++vit2) {