Fix clang-tidy performance-for-range-copy warnings

This commit is contained in:
Tim Wojtulewicz 2025-04-25 13:47:14 -07:00
parent 178d7f4cd0
commit b8e28abb97
3 changed files with 3 additions and 2 deletions

View file

@ -3,6 +3,7 @@ Checks: [-*,
performance-avoid-endl, performance-avoid-endl,
performance-enum-size, performance-enum-size,
performance-faster-string-find, performance-faster-string-find,
performance-for-range-copy,
# Skipping these temporarily because they are very noisy # Skipping these temporarily because they are very noisy
-bugprone-narrowing-conversions, -bugprone-narrowing-conversions,

View file

@ -651,7 +651,7 @@ bool ProfileFuncs::HasSideEffects(SideEffectsOp::AccessType access, const TypePt
bool ProfileFuncs::GetSideEffects(SideEffectsOp::AccessType access, const Type* t, IDSet& non_local_ids, bool ProfileFuncs::GetSideEffects(SideEffectsOp::AccessType access, const Type* t, IDSet& non_local_ids,
TypeSet& aggrs) const { TypeSet& aggrs) const {
for ( auto se : side_effects_ops ) for ( const auto& se : side_effects_ops )
if ( AssessSideEffects(se.get(), access, t, non_local_ids, aggrs) ) if ( AssessSideEffects(se.get(), access, t, non_local_ids, aggrs) )
return true; return true;

View file

@ -926,7 +926,7 @@ static bool simplify_chain(const std::vector<StmtPtr>& stmts, unsigned int start
// At this point, chain_stmts has only the remainders that weren't removed. // At this point, chain_stmts has only the remainders that weren't removed.
for ( auto s : stmts ) for ( auto s : stmts )
if ( chain_stmts.count(s.get()) > 0 ) if ( chain_stmts.count(s.get()) > 0 )
f_stmts.push_back(s); f_stmts.push_back(std::move(s));
return true; return true;
} }