Skip to content

Commit 96b0ff4

Browse files
Use ranged-for instead of iterators
1 parent b0ec79a commit 96b0ff4

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/goto-symex/symex_goto.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,10 @@ void goto_symext::phi_function(
386386
diff_guard-=dest_state.guard;
387387
}
388388

389-
for(auto it = all_current_names_range.begin();
390-
it != all_current_names_range.end();
391-
++it)
389+
for(const auto &ssa : all_current_names_range)
392390
{
393-
const irep_idt l1_identifier=it->get_identifier();
394-
const irep_idt &obj_identifier=it->get_object_name();
391+
const irep_idt l1_identifier = ssa.get_identifier();
392+
const irep_idt &obj_identifier = ssa.get_object_name();
395393

396394
if(obj_identifier==guard_identifier)
397395
continue; // just a guard, don't bother
@@ -416,11 +414,12 @@ void goto_symext::phi_function(
416414
// may have been introduced by symex_start_thread (and will
417415
// only later be removed from level2.current_names by pop_frame
418416
// once the thread is executed)
419-
if(!it->get_level_0().empty() &&
420-
it->get_level_0()!=std::to_string(dest_state.source.thread_nr))
417+
if(
418+
!ssa.get_level_0().empty() &&
419+
ssa.get_level_0() != std::to_string(dest_state.source.thread_nr))
421420
continue;
422421

423-
exprt goto_state_rhs=*it, dest_state_rhs=*it;
422+
exprt goto_state_rhs = ssa, dest_state_rhs = ssa;
424423

425424
{
426425
const auto p_it = goto_state.propagation.find(l1_identifier);
@@ -466,7 +465,7 @@ void goto_symext::phi_function(
466465
do_simplify(rhs);
467466
}
468467

469-
ssa_exprt new_lhs=*it;
468+
ssa_exprt new_lhs = ssa;
470469
const bool record_events=dest_state.record_events;
471470
dest_state.record_events=false;
472471
dest_state.assignment(new_lhs, rhs, ns, true, true);

0 commit comments

Comments
 (0)