@@ -23,10 +23,8 @@ void java_bytecode_parse_treet::output(std::ostream &out) const
23
23
parsed_class.output (out);
24
24
25
25
out << " Class references:\n " ;
26
- for (class_refst::const_iterator it=class_refs.begin ();
27
- it!=class_refs.end ();
28
- it++)
29
- out << " " << *it << ' \n ' ;
26
+ for (const auto &class_ref : class_refs)
27
+ out << " " << class_ref << ' \n ' ;
30
28
}
31
29
32
30
void java_bytecode_parse_treet::classt::output (std::ostream &out) const
@@ -42,23 +40,13 @@ void java_bytecode_parse_treet::classt::output(std::ostream &out) const
42
40
out << " extends " << super_class;
43
41
out << " {" << ' \n ' ;
44
42
45
- for (fieldst::const_iterator
46
- it=fields.begin ();
47
- it!=fields.end ();
48
- it++)
49
- {
50
- it->output (out);
51
- }
43
+ for (const auto &field : fields)
44
+ field.output (out);
52
45
53
46
out << ' \n ' ;
54
47
55
- for (methodst::const_iterator
56
- it=methods.begin ();
57
- it!=methods.end ();
58
- it++)
59
- {
60
- it->output (out);
61
- }
48
+ for (const auto &method : methods)
49
+ method.output (out);
62
50
63
51
out << ' }' << ' \n ' ;
64
52
out << ' \n ' ;
@@ -175,16 +163,18 @@ void java_bytecode_parse_treet::methodt::output(std::ostream &out) const
175
163
out << " " << i.address << " : " ;
176
164
out << i.statement ;
177
165
178
- for (std::vector<exprt>::const_iterator
179
- a_it= i.args . begin (); a_it!=i. args . end (); a_it++ )
166
+ bool first = true ;
167
+ for ( const auto &arg : i.args )
180
168
{
181
- if (a_it!=i.args .begin ())
169
+ if (first)
170
+ first = false ;
171
+ else
182
172
out << ' ,' ;
183
- #if 0
184
- out << ' ' << from_expr(*a_it );
185
- #else
186
- out << ' ' << expr2java (*a_it , ns);
187
- #endif
173
+ #if 0
174
+ out << ' ' << from_expr(arg );
175
+ #else
176
+ out << ' ' << expr2java (arg , ns);
177
+ #endif
188
178
}
189
179
190
180
out << ' \n ' ;
0 commit comments