mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38: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
|
@ -34,14 +34,13 @@ std::set<std::string> val_to_topic_set(zeek::Val* val)
|
|||
if ( tbl->Length() == 0 )
|
||||
return rval;
|
||||
|
||||
zeek::IterCookie* c = tbl->InitForIteration();
|
||||
zeek::detail::HashKey* k;
|
||||
|
||||
while ( tbl->NextEntry(k, c) )
|
||||
for ( const auto& te : *tbl )
|
||||
{
|
||||
auto k = te.GetHashKey();
|
||||
auto* v = te.GetValue<zeek::TableEntryVal*>();
|
||||
|
||||
auto index = val->AsTableVal()->RecreateIndex(*k);
|
||||
rval.emplace(index->Idx(0)->AsString()->CheckString());
|
||||
delete k;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue