mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28:20 +00:00
use iterator-based idiom for check-if-present-then-access
This commit is contained in:
parent
735d584d9f
commit
84423369b4
12 changed files with 86 additions and 59 deletions
|
@ -306,10 +306,13 @@ AttrInfo::AttrInfo(CPPCompile* _c, const AttrPtr& attr) : CompoundItemInfo(_c)
|
|||
|
||||
AttrsInfo::AttrsInfo(CPPCompile* _c, const AttributesPtr& _attrs) : CompoundItemInfo(_c)
|
||||
{
|
||||
const auto& pas = c->ProcessedAttr();
|
||||
|
||||
for ( const auto& a : _attrs->GetAttrs() )
|
||||
{
|
||||
ASSERT(c->ProcessedAttr().count(a.get()) > 0);
|
||||
const auto& gi = c->ProcessedAttr().at(a.get());
|
||||
auto pa = pas.find(a.get());
|
||||
ASSERT(pa != pas.end());
|
||||
const auto& gi = pa->second;
|
||||
init_cohort = max(init_cohort, gi->InitCohort() + 1);
|
||||
vals.emplace_back(Fmt(gi->Offset()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue