Skip to content

Use ranged-for to iterate over value_sett:valuest #4274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/pointer-analysis/value_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,11 @@ void value_sett::output(
const namespacet &ns,
std::ostream &out) const
{
for(valuest::const_iterator
v_it=values.begin();
v_it!=values.end();
v_it++)
for(const auto &values_entry : values)
{
irep_idt identifier, display_name;

const entryt &e=v_it->second;
const entryt &e = values_entry.second;

if(has_prefix(id2string(e.identifier), "value_set::dynamic_object"))
{
Expand Down
12 changes: 4 additions & 8 deletions src/pointer-analysis/value_set_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,12 @@ void value_sets_to_xml(
xmlt &i=dest.new_element("instruction");
i.new_element()=::xml(location);

for(value_sett::valuest::const_iterator
v_it=value_set.values.begin();
v_it!=value_set.values.end();
v_it++)
for(const auto &values_entry : value_set.values)
{
xmlt &var=i.new_element("variable");
var.new_element("identifier").data=
id2string(v_it->first);
var.new_element("identifier").data = id2string(values_entry.first);

#if 0
#if 0
const value_sett::expr_sett &expr_set=
v_it->second.expr_set();

Expand All @@ -65,7 +61,7 @@ void value_sets_to_xml(
var.new_element("value").data=
xmlt::escape(value_str);
}
#endif
#endif
}
}
}
Expand Down