diff --git a/CHANGES b/CHANGES index dc0d2e4e63..1a6721eeb0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ +2.5-368 | 2017-12-08 13:09:25 -0600 + + * Improve for-loop iteration performance over empty tables. (Justin Azoff) + + * Fix gcc7 warnings. (Johanna Amann) + 2.5-363 | 2017-12-05 11:00:09 -0600 * Fix documentation for ReassemblerStats. (Corelight) diff --git a/VERSION b/VERSION index f22c264edd..91bd48a9c6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5-363 +2.5-368 diff --git a/src/Stmt.cc b/src/Stmt.cc index d93e8ff14e..71100e51e2 100644 --- a/src/Stmt.cc +++ b/src/Stmt.cc @@ -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) )