mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +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
|
@ -1261,14 +1261,13 @@ Supervisor::NodeConfig Supervisor::NodeConfig::FromRecord(const RecordVal* node)
|
|||
|
||||
auto cluster_table_val = node->GetField("cluster")->AsTableVal();
|
||||
auto cluster_table = cluster_table_val->AsTable();
|
||||
auto c = cluster_table->InitForIteration();
|
||||
detail::HashKey* k;
|
||||
TableEntryVal* v;
|
||||
|
||||
while ( (v = cluster_table->NextEntry(k, c)) )
|
||||
for ( const auto& cte : *cluster_table )
|
||||
{
|
||||
auto k = cte.GetHashKey();
|
||||
auto* v = cte.GetValue<TableEntryVal*>();
|
||||
|
||||
auto key = cluster_table_val->RecreateIndex(*k);
|
||||
delete k;
|
||||
auto name = key->Idx(0)->AsStringVal()->ToStdString();
|
||||
auto rv = v->GetVal()->AsRecordVal();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue