From: Matthew Fernandez <matthew.fernandez@gmail.com> Date: Sat, 12 Jun 2021 19:32:11 +0000 (-0700) Subject: replace manual iteration in Blocks::dfsVisit with range-based for loop X-Git-Tag: 2.48.0~44^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2599ccf8190b43d155a896a960b86b1be77ecfb6;p=graphviz replace manual iteration in Blocks::dfsVisit with range-based for loop This C++11 syntax does the same thing. --- diff --git a/lib/vpsc/blocks.cpp b/lib/vpsc/blocks.cpp index 47ae790e6..f8b09e5cc 100644 --- a/lib/vpsc/blocks.cpp +++ b/lib/vpsc/blocks.cpp @@ -70,9 +70,7 @@ list<Variable*> *Blocks::totalOrder() { // onto the front of the list when we finish searching them void Blocks::dfsVisit(Variable *v, list<Variable*> &order) { v->visited=true; - vector<Constraint*>::iterator it=v->out.begin(); - for(;it!=v->out.end();it++) { - Constraint *c=*it; + for (Constraint *c : v->out) { if(!c->right->visited) { dfsVisit(c->right, order); }