mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Use std::move() where possible in parse.y build_local()/build_global()
This commit is contained in:
parent
0b45ff2179
commit
5ffe25fca8
1 changed files with 3 additions and 2 deletions
|
@ -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());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue