mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
script optimization support for clearing tables/vectors using "delete"
This commit is contained in:
parent
ce6d77e2ce
commit
74d36eb759
6 changed files with 37 additions and 8 deletions
|
@ -255,7 +255,7 @@ StmtPtr IfStmt::DoReduce(Reducer* c) {
|
|||
sl = make_intrusive<StmtList>(red_e_stmt, ThisPtr());
|
||||
|
||||
if ( sl )
|
||||
return TransformMe(sl, c);
|
||||
return TransformMe(std::move(sl), c);
|
||||
|
||||
return ThisPtr();
|
||||
}
|
||||
|
@ -418,14 +418,10 @@ StmtPtr AddDelStmt::DoReduce(Reducer* c) {
|
|||
return ThisPtr();
|
||||
}
|
||||
|
||||
if ( e->Tag() != EXPR_INDEX && e->Tag() != EXPR_FIELD )
|
||||
Internal("bad \"add\"/\"delete\"");
|
||||
|
||||
auto red_e_stmt = e->ReduceToSingletons(c);
|
||||
|
||||
if ( red_e_stmt )
|
||||
return TransformMe(make_intrusive<StmtList>(red_e_stmt, ThisPtr()), c);
|
||||
|
||||
else
|
||||
return ThisPtr();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue