Skip to content

Commit ca520cd

Browse files
committed
Use ranged-for to iterate over value_sett:valuest
This is easier to read and simplifies switching between representations.
1 parent c31ab35 commit ca520cd

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/pointer-analysis/value_set.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,11 @@ void value_sett::output(
9898
const namespacet &ns,
9999
std::ostream &out) const
100100
{
101-
for(valuest::const_iterator
102-
v_it=values.begin();
103-
v_it!=values.end();
104-
v_it++)
101+
for(const auto &values_entry : values)
105102
{
106103
irep_idt identifier, display_name;
107104

108-
const entryt &e=v_it->second;
105+
const entryt &e = values_entry.second;
109106

110107
if(has_prefix(id2string(e.identifier), "value_set::dynamic_object"))
111108
{

src/pointer-analysis/value_set_analysis.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ void value_sets_to_xml(
4141
xmlt &i=dest.new_element("instruction");
4242
i.new_element()=::xml(location);
4343

44-
for(value_sett::valuest::const_iterator
45-
v_it=value_set.values.begin();
46-
v_it!=value_set.values.end();
47-
v_it++)
44+
for(const auto &values_entry : value_set.values)
4845
{
4946
xmlt &var=i.new_element("variable");
5047
var.new_element("identifier").data=
51-
id2string(v_it->first);
48+
id2string(values_entry.first);
5249

5350
#if 0
5451
const value_sett::expr_sett &expr_set=

0 commit comments

Comments
 (0)