File tree Expand file tree Collapse file tree 1 file changed +9
-20
lines changed
Expand file tree Collapse file tree 1 file changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -20,26 +20,15 @@ std::vector<codet>
2020require_goto_statements::get_all_statements (const exprt &function_value)
2121{
2222 std::vector<codet> statements;
23-
24- // Add any child statements (e.g. if this is a code_block
25- // TODO(tkiley): It should be possible to have a custom version of
26- // TODO(tkiley): back_inserter that also transforms to codet, but I don't
27- // TODO(tkiley): know how to do this
28- std::vector<exprt> sub_expr;
29- std::copy_if (
30- function_value.depth_begin (),
31- function_value.depth_end (),
32- std::back_inserter (sub_expr),
33- [](const exprt &sub_statement) {
34- // Get all codet
35- return sub_statement.id () == ID_code;
36- });
37-
38- std::transform (
39- sub_expr.begin (),
40- sub_expr.end (),
41- std::back_inserter (statements),
42- [](const exprt &sub_expr) { return to_code (sub_expr); });
23+ for (auto sub_expression_it = function_value.depth_begin ();
24+ sub_expression_it != function_value.depth_end ();
25+ ++sub_expression_it)
26+ {
27+ if (sub_expression_it->id () == ID_code)
28+ {
29+ statements.push_back (to_code (*sub_expression_it));
30+ }
31+ }
4332
4433 return statements;
4534}
You can’t perform that action at this time.
0 commit comments