@@ -419,19 +419,17 @@ bool goto_symex_statet::l2_thread_read_encoding(
419
419
read_guard.add (false_exprt ());
420
420
421
421
a_s_r_entryt &a_s_read=read_in_atomic_section[ssa_l1];
422
- for (std::list<guardt>::const_iterator it=a_s_read.second .begin ();
423
- it!=a_s_read.second .end ();
424
- ++it)
422
+ for (const auto &a_s_read_guard : a_s_read.second )
425
423
{
426
- guardt g=*it;
424
+ guardt g = a_s_read_guard; // copy
427
425
g-=guard;
428
426
if (g.is_true ())
429
427
// there has already been a read l1_identifier within
430
428
// this atomic section under the same guard, or a guard
431
429
// that implies the current one
432
430
return false ;
433
431
434
- read_guard|=*it ;
432
+ read_guard |= a_s_read_guard ;
435
433
}
436
434
437
435
exprt cond=read_guard.as_expr ();
@@ -672,15 +670,14 @@ void goto_symex_statet::rename(
672
670
struct_union_typet &s_u_type=to_struct_union_type (type);
673
671
struct_union_typet::componentst &components=s_u_type.components ();
674
672
675
- for (struct_union_typet::componentst::iterator
676
- it=components.begin ();
677
- it!=components.end ();
678
- ++it)
673
+ for (auto &component : components)
674
+ {
679
675
// be careful, or it might get cyclic
680
- if (it->type ().id ()==ID_array)
681
- rename (to_array_type (it->type ()).size (), ns, level);
682
- else if (it->type ().id ()!=ID_pointer)
683
- rename (it->type (), irep_idt (), ns, level);
676
+ if (component.type ().id () == ID_array)
677
+ rename (to_array_type (component.type ()).size (), ns, level);
678
+ else if (component.type ().id () != ID_pointer)
679
+ rename (component.type (), irep_idt (), ns, level);
680
+ }
684
681
}
685
682
else if (type.id ()==ID_pointer)
686
683
{
@@ -739,11 +736,8 @@ void goto_symex_statet::get_original_name(typet &type) const
739
736
struct_union_typet &s_u_type=to_struct_union_type (type);
740
737
struct_union_typet::componentst &components=s_u_type.components ();
741
738
742
- for (struct_union_typet::componentst::iterator
743
- it=components.begin ();
744
- it!=components.end ();
745
- ++it)
746
- get_original_name (it->type ());
739
+ for (auto &component : components)
740
+ get_original_name (component.type ());
747
741
}
748
742
else if (type.id ()==ID_pointer)
749
743
{
0 commit comments