Skip to content

Commit c6e3007

Browse files
Used range iterators
1 parent 7ef866c commit c6e3007

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

src/goto-programs/goto_functions_template.h

+8-21
Original file line numberDiff line numberDiff line change
@@ -185,42 +185,29 @@ template <class bodyT>
185185
void goto_functions_templatet<bodyT>::compute_location_numbers()
186186
{
187187
unsigned nr=0;
188-
189-
for(typename function_mapt::iterator
190-
it=function_map.begin();
191-
it!=function_map.end();
192-
it++)
193-
it->second.body.compute_location_numbers(nr);
188+
for(auto &named_function : function_map)
189+
named_function.second.body.compute_location_numbers(nr);
194190
}
195191

196192
template <class bodyT>
197193
void goto_functions_templatet<bodyT>::compute_incoming_edges()
198194
{
199-
for(typename function_mapt::iterator
200-
it=function_map.begin();
201-
it!=function_map.end();
202-
it++)
203-
it->second.body.compute_incoming_edges();
195+
for(auto &named_function : function_map)
196+
named_function.second.body.compute_incoming_edges();
204197
}
205198

206199
template <class bodyT>
207200
void goto_functions_templatet<bodyT>::compute_target_numbers()
208201
{
209-
for(typename function_mapt::iterator
210-
it=function_map.begin();
211-
it!=function_map.end();
212-
it++)
213-
it->second.body.compute_target_numbers();
202+
for(auto &named_function : function_map)
203+
named_function.second.body.compute_target_numbers();
214204
}
215205

216206
template <class bodyT>
217207
void goto_functions_templatet<bodyT>::compute_loop_numbers()
218208
{
219-
for(typename function_mapt::iterator
220-
it=function_map.begin();
221-
it!=function_map.end();
222-
it++)
223-
it->second.body.compute_loop_numbers();
209+
for(auto &named_function : function_map)
210+
named_function.second.body.compute_loop_numbers();
224211
}
225212

226213
#endif // CPROVER_GOTO_PROGRAMS_GOTO_FUNCTIONS_TEMPLATE_H

0 commit comments

Comments
 (0)