mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +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
|
@ -52,8 +52,9 @@ template <class T> string CPPTracker<T>::KeyName(const T* key)
|
|||
ASSERT(hash != 0);
|
||||
|
||||
auto rep = reps[hash];
|
||||
if ( gi_s.count(rep) > 0 )
|
||||
return gi_s[rep]->Name();
|
||||
auto gi = gi_s.find(rep);
|
||||
if ( gi != gi_s.end() )
|
||||
return gi->second->Name();
|
||||
|
||||
auto index = map2[hash];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue