mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Use .contains() instead of .find() or .count()
This commit is contained in:
parent
d20550f553
commit
b592b6c998
68 changed files with 201 additions and 207 deletions
|
@ -159,11 +159,11 @@ void CPPCompile::DeclareLocals(const ProfileFunc* pf, const IDPList* lambda_ids)
|
|||
auto ln = LocalName(l);
|
||||
auto cn = CaptureName(l);
|
||||
|
||||
if ( capture_names.count(cn) > 0 )
|
||||
if ( capture_names.contains(cn) )
|
||||
// No need to declare these, they're passed in as parameters.
|
||||
ln = cn;
|
||||
|
||||
else if ( params.count(l) == 0 && l->Offset() >= num_params ) { // Not a parameter, so must be a local.
|
||||
else if ( ! params.contains(l) && l->Offset() >= num_params ) { // Not a parameter, so must be a local.
|
||||
Emit("%s %s;", FullTypeName(l->GetType()), ln);
|
||||
did_decl = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue