Skip to content

Commit 8583395

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

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
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: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,10 @@ 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

5349
#if 0
5450
const value_sett::expr_sett &expr_set=

0 commit comments

Comments
 (0)