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:
Jon Siwek 2017-12-08 13:09:25 -06:00
commit 895e7b06b1
3 changed files with 10 additions and 1 deletions

View file

@ -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) )