From: Matthew Fernandez Date: Sat, 26 Jun 2021 18:38:26 +0000 (-0700) Subject: rephrase accumulate loop in Blocks::cost using a range-based for-loop X-Git-Tag: 2.48.0~23^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06566922dd383a340b58321e60cf9f92c79f9160;p=graphviz rephrase accumulate loop in Blocks::cost using a range-based for-loop --- diff --git a/lib/vpsc/blocks.cpp b/lib/vpsc/blocks.cpp index 3c2b97e7f..9ac995620 100644 --- a/lib/vpsc/blocks.cpp +++ b/lib/vpsc/blocks.cpp @@ -194,9 +194,8 @@ void Blocks::split(Block *b, Block *&l, Block *&r, Constraint *c) { */ double Blocks::cost() { double c = 0; - for(set::iterator i=begin();i!=end();i++) { - c += (*i)->cost(); + for (Block *b : *this) { + c += b->cost(); } return c; } -