Skip to content

Commit 426d450

Browse files
Use ranged-for instead of iterators
1 parent f6c987d commit 426d450

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/goto-symex/symex_atomic_section.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,16 @@ void goto_symext::symex_atomic_end(statet &state)
4545
const unsigned atomic_section_id=state.atomic_section_id;
4646
state.atomic_section_id=0;
4747

48-
for(goto_symex_statet::read_in_atomic_sectiont::const_iterator
49-
r_it=state.read_in_atomic_section.begin();
50-
r_it!=state.read_in_atomic_section.end();
51-
++r_it)
48+
for(const auto &pair : state.read_in_atomic_section)
5249
{
53-
ssa_exprt r=r_it->first;
54-
r.set_level_2(r_it->second.first);
50+
ssa_exprt r = pair.first;
51+
r.set_level_2(pair.second.first);
5552

5653
// guard is the disjunction over reads
57-
PRECONDITION(!r_it->second.second.empty());
58-
guardt read_guard(r_it->second.second.front());
59-
for(std::list<guardt>::const_iterator
60-
it=++(r_it->second.second.begin());
61-
it!=r_it->second.second.end();
54+
PRECONDITION(!pair.second.second.empty());
55+
guardt read_guard(pair.second.second.front());
56+
for(std::list<guardt>::const_iterator it = ++(pair.second.second.begin());
57+
it != pair.second.second.end();
6258
++it)
6359
read_guard|=*it;
6460
exprt read_guard_expr=read_guard.as_expr();

0 commit comments

Comments
 (0)