mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +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
|
@ -591,6 +591,16 @@ const ZAMStmt ZAMCompiler::CompileAdd(const AddStmt* as) {
|
|||
|
||||
const ZAMStmt ZAMCompiler::CompileDel(const DelStmt* ds) {
|
||||
auto e = ds->StmtExprPtr();
|
||||
|
||||
if ( e->Tag() == EXPR_NAME ) {
|
||||
auto n = e->AsNameExpr();
|
||||
|
||||
if ( n->GetType()->Tag() == TYPE_TABLE )
|
||||
return ClearTableV(n);
|
||||
else
|
||||
return ClearVectorV(n);
|
||||
}
|
||||
|
||||
auto aggr = e->GetOp1()->AsNameExpr();
|
||||
|
||||
if ( e->Tag() == EXPR_FIELD ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue