Skip to content

Commit 62e5b3e

Browse files
author
Daniel Kroening
committed
introduce ranged for in cover_goals
1 parent ef3de3f commit 62e5b3e

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/solvers/prop/cover_goals.cpp

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,10 @@ 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 &&
53+
!g.condition.is_false())
54+
disjuncts.push_back(literal_exprt(g.condition));
5855

5956
// this is 'false' if there are no disjuncts
6057
prop_conv.set_to_true(disjunction(disjuncts));
@@ -63,12 +60,9 @@ void cover_goalst::constraint()
6360
/// Build clause
6461
void cover_goalst::freeze_goal_variables()
6562
{
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);
63+
for(const auto &g : goals)
64+
if(!g.condition.is_constant())
65+
prop_conv.set_frozen(g.condition);
7266
}
7367

7468
/// Try to cover all goals

0 commit comments

Comments
 (0)