mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
Implement standard-library-compatible iterators for Dictionary
This commit is contained in:
parent
9e9998c6e5
commit
892124378c
16 changed files with 834 additions and 254 deletions
|
@ -927,14 +927,12 @@ broker::expected<broker::data> val_to_data(const Val* v)
|
|||
else
|
||||
rval = broker::table();
|
||||
|
||||
zeek::detail::HashKey* hk;
|
||||
TableEntryVal* entry;
|
||||
auto c = table->InitForIteration();
|
||||
|
||||
while ( (entry = table->NextEntry(hk, c)) )
|
||||
for ( const auto& te : *table )
|
||||
{
|
||||
auto hk = te.GetHashKey();
|
||||
auto* entry = te.GetValue<TableEntryVal*>();
|
||||
|
||||
auto vl = table_val->RecreateIndex(*hk);
|
||||
delete hk;
|
||||
|
||||
broker::vector composite_key;
|
||||
composite_key.reserve(vl->Length());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue