Skip to content

Commit 1a970e3

Browse files
authored
Merge pull request #4274 from tautschnig/value-set_ranged_for
Use ranged-for to iterate over value_sett:valuest
2 parents 5c8839f + 24f1625 commit 1a970e3

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

src/pointer-analysis/value_set.cpp

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

109-
const entryt &e=v_it->second;
106+
const entryt &e = values_entry.second;
110107

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

src/pointer-analysis/value_set_analysis.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,12 @@ 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");
50-
var.new_element("identifier").data=
51-
id2string(v_it->first);
47+
var.new_element("identifier").data = id2string(values_entry.first);
5248

53-
#if 0
49+
#if 0
5450
const value_sett::expr_sett &expr_set=
5551
v_it->second.expr_set();
5652

@@ -65,7 +61,7 @@ void value_sets_to_xml(
6561
var.new_element("value").data=
6662
xmlt::escape(value_str);
6763
}
68-
#endif
64+
#endif
6965
}
7066
}
7167
}

0 commit comments

Comments
 (0)