mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38: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
|
@ -18,8 +18,9 @@ std::shared_ptr<CPP_InitInfo> CPPCompile::RegisterInitExpr(const ExprPtr& ep)
|
|||
{
|
||||
auto ename = InitExprName(ep);
|
||||
|
||||
if ( init_infos.count(ename) )
|
||||
return init_infos[ename];
|
||||
auto ii = init_infos.find(ename);
|
||||
if ( ii != init_infos.end() )
|
||||
return ii->second;
|
||||
|
||||
auto wrapper_cl = string("wrapper_") + ename + "_cl";
|
||||
|
||||
|
@ -247,8 +248,9 @@ void CPPCompile::GenStandaloneActivation()
|
|||
// We didn't wind up compiling it.
|
||||
continue;
|
||||
|
||||
ASSERT(body_hashes.count(bname) > 0);
|
||||
func_bodies[f].push_back(body_hashes[bname]);
|
||||
auto bh = body_hashes.find(bname);
|
||||
ASSERT(bh != body_hashes.end());
|
||||
func_bodies[f].push_back(bh->second);
|
||||
}
|
||||
|
||||
for ( auto& fb : func_bodies )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue