mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
Merge branch 'topic/jazoff/speedup-for'
* topic/jazoff/speedup-for: problem: for loops over empty tables are slow. BIT-1878 #merged
This commit is contained in:
commit
895e7b06b1
3 changed files with 10 additions and 1 deletions
|
@ -1293,6 +1293,9 @@ Val* ForStmt::DoExec(Frame* f, Val* v, stmt_flow_type& flow) const
|
|||
TableVal* tv = v->AsTableVal();
|
||||
const PDict(TableEntryVal)* loop_vals = tv->AsTable();
|
||||
|
||||
if ( ! loop_vals->Length() )
|
||||
return 0;
|
||||
|
||||
HashKey* k;
|
||||
IterCookie* c = loop_vals->InitForIteration();
|
||||
while ( loop_vals->NextEntry(k, c) )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue