Skip to content

Commit 23d2409

Browse files
author
Daniel Kroening
committed
introduce ranged for in cover_goals
1 parent 91f8fd8 commit 23d2409

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/solvers/prop/cover_goals.cpp

+6-13
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,9 @@ void cover_goalst::constraint()
4848

4949
// cover at least one unknown goal
5050

51-
for(std::list<goalt>::const_iterator
52-
g_it=goals.begin();
53-
g_it!=goals.end();
54-
g_it++)
55-
if(g_it->status==goalt::statust::UNKNOWN &&
56-
!g_it->condition.is_false())
57-
disjuncts.push_back(literal_exprt(g_it->condition));
51+
for(const auto &g : goals)
52+
if(g.status == goalt::statust::UNKNOWN && !g.condition.is_false())
53+
disjuncts.push_back(literal_exprt(g.condition));
5854

5955
// this is 'false' if there are no disjuncts
6056
prop_conv.set_to_true(disjunction(disjuncts));
@@ -63,12 +59,9 @@ void cover_goalst::constraint()
6359
/// Build clause
6460
void cover_goalst::freeze_goal_variables()
6561
{
66-
for(std::list<goalt>::const_iterator
67-
g_it=goals.begin();
68-
g_it!=goals.end();
69-
g_it++)
70-
if(!g_it->condition.is_constant())
71-
prop_conv.set_frozen(g_it->condition);
62+
for(const auto &g : goals)
63+
if(!g.condition.is_constant())
64+
prop_conv.set_frozen(g.condition);
7265
}
7366

7467
/// Try to cover all goals

0 commit comments

Comments
 (0)