diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-11 13:40:26 +0300 |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-12 16:22:47 +0300 |
commit | 7d5095796ab616cf9b709036387bb95ab9984141 (patch) | |
tree | c010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmComputeComponentGraph.cxx | |
parent | 00975e926199eea21763470e2ab876246e36669a (diff) | |
download | cmake-7d5095796ab616cf9b709036387bb95ab9984141.tar.gz |
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.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx index a02d8854b2..9ec98ae8e8 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())); } } } |