Use .contains() instead of .find() or .count()

This commit is contained in:
Tim Wojtulewicz 2025-07-23 16:34:44 -07:00
parent d20550f553
commit b592b6c998
68 changed files with 201 additions and 207 deletions

View file

@ -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;
}