Remove superflous std::move's from Inliner return values

This commit is contained in:
Jon Siwek 2020-12-13 13:44:00 -08:00
parent 09d12c3716
commit 4824da0325

View file

@ -163,25 +163,25 @@ ExprPtr Inliner::CheckForInlining(IntrusivePtr<CallExpr> c)
if ( f->Tag() != EXPR_NAME ) if ( f->Tag() != EXPR_NAME )
// We don't inline indirect calls. // We don't inline indirect calls.
return std::move(c); return c;
auto n = f->AsNameExpr(); auto n = f->AsNameExpr();
auto func = n->Id(); auto func = n->Id();
if ( ! func->IsGlobal() ) if ( ! func->IsGlobal() )
return std::move(c); return c;
const auto& func_v = func->GetVal(); const auto& func_v = func->GetVal();
if ( ! func_v ) if ( ! func_v )
return std::move(c); return c;
auto func_vf = func_v->AsFunc()->AsScriptFunc(); auto func_vf = func_v->AsFunc()->AsScriptFunc();
if ( ! func_vf ) if ( ! func_vf )
return std::move(c); return c;
if ( inline_ables.count(func_vf) == 0 ) if ( inline_ables.count(func_vf) == 0 )
return std::move(c); return c;
ListExprPtr args = {NewRef{}, c->Args()}; ListExprPtr args = {NewRef{}, c->Args()};
auto body = func_vf->GetBodies()[0].stmts; // there's only 1 body auto body = func_vf->GetBodies()[0].stmts; // there's only 1 body