summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeComponentGraph.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-11 10:40:26 (GMT)
committerPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-12 13:22:47 (GMT)
commit7d5095796ab616cf9b709036387bb95ab9984141 (patch)
treec010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmComputeComponentGraph.cxx
parent00975e926199eea21763470e2ab876246e36669a (diff)
downloadCMake-7d5095796ab616cf9b709036387bb95ab9984141.zip
CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.gz
CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.bz2
Meta: modernize old-fashioned loops to range-based `for`.
Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
Diffstat (limited to 'Source/cmComputeComponentGraph.cxx')
-rw-r--r--Source/cmComputeComponentGraph.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx
index a02d885..9ec98ae 100644
--- a/Source/cmComputeComponentGraph.cxx
+++ b/Source/cmComputeComponentGraph.cxx
@@ -57,8 +57,8 @@ void cmComputeComponentGraph::TarjanVisit(int i)
// Follow outgoing edges.
EdgeList const& nl = this->InputGraph[i];
- for (EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) {
- int j = *ni;
+ for (cmGraphEdge const& ni : nl) {
+ int j = ni;
// Ignore edges to nodes that have been reached by a previous DFS
// walk. Since we did not reach the current node from that walk
@@ -119,14 +119,14 @@ void cmComputeComponentGraph::TransferEdges()
for (int i = 0; i < n; ++i) {
int i_component = this->TarjanComponents[i];
EdgeList const& nl = this->InputGraph[i];
- for (EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) {
- int j = *ni;
+ for (cmGraphEdge const& ni : nl) {
+ int j = ni;
int j_component = this->TarjanComponents[j];
if (i_component != j_component) {
// We do not attempt to combine duplicate edges, but instead
// store the inter-component edges with suitable multiplicity.
this->ComponentGraph[i_component].push_back(
- cmGraphEdge(j_component, ni->IsStrong()));
+ cmGraphEdge(j_component, ni.IsStrong()));
}
}
}