From 06566922dd383a340b58321e60cf9f92c79f9160 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 26 Jun 2021 11:38:26 -0700 Subject: [PATCH] rephrase accumulate loop in Blocks::cost using a range-based for-loop --- lib/vpsc/blocks.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; } - -- 2.40.0