Skip to content

Commit

Permalink
Removed unnecessary stmt vec.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanay-man committed Aug 18, 2024
1 parent fd68735 commit a689d98
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/lpython/semantics/python_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5251,21 +5251,16 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
current_scope = f->m_symtab;
Vec<ASR::stmt_t*> body_asr;
body_asr.reserve(al, x.n_body);
Vec<ASR::stmt_t*> new_body_asr;
new_body_asr.reserve(al,1);
if ( super_call_stmt ) {
new_body_asr.push_back(al, super_call_stmt);
body_asr.push_back(al, super_call_stmt);
}
Vec<ASR::symbol_t*> rts;
rts.reserve(al, 4);
dependencies.clear(al);
transform_stmts(body_asr, body.n, body.p);
for (size_t i=0; i<body_asr.size();i++) {
new_body_asr.push_back(al,body_asr[i]);
}
for (const auto &rt: rt_vec) { rts.push_back(al, rt); }
f->m_body = new_body_asr.p;
f->n_body = new_body_asr.size();
f->m_body = body_asr.p;
f->n_body = body_asr.size();
ASR::FunctionType_t* func_type = ASR::down_cast<ASR::FunctionType_t>(
f->m_function_signature);
func_type->m_restrictions = rts.p;
Expand Down

0 comments on commit a689d98

Please sign in to comment.