Use std::move() where possible in parse.y build_local()/build_global()

This commit is contained in:
Jon Siwek 2021-04-02 11:38:25 -07:00
parent 0b45ff2179
commit 5ffe25fca8

View file

@ -242,7 +242,7 @@ static void build_global(ID* id, Type* t, InitClass ic, Expr* e,
auto attrs_ptr = attrs ? std::make_unique<std::vector<AttrPtr>>(*attrs) : nullptr; auto attrs_ptr = attrs ? std::make_unique<std::vector<AttrPtr>>(*attrs) : nullptr;
add_global(id_ptr, t_ptr, ic, e_ptr, std::move(attrs_ptr), dt); add_global(id_ptr, std::move(t_ptr), ic, e_ptr, std::move(attrs_ptr), dt);
if ( dt == VAR_REDEF ) if ( dt == VAR_REDEF )
zeekygen_mgr->Redef(id, ::filename, ic, std::move(e_ptr)); zeekygen_mgr->Redef(id, ::filename, ic, std::move(e_ptr));
@ -260,7 +260,8 @@ static StmtPtr build_local(ID* id, Type* t, InitClass ic, Expr* e,
auto attrs_ptr = attrs ? std::make_unique<std::vector<AttrPtr>>(*attrs) : nullptr; auto attrs_ptr = attrs ? std::make_unique<std::vector<AttrPtr>>(*attrs) : nullptr;
auto init = add_local(id_ptr, t_ptr, ic, e_ptr, std::move(attrs_ptr), dt); auto init = add_local(std::move(id_ptr), std::move(t_ptr), ic,
std::move(e_ptr), std::move(attrs_ptr), dt);
if ( do_coverage ) if ( do_coverage )
script_coverage_mgr.AddStmt(init.get()); script_coverage_mgr.AddStmt(init.get());