mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix recent Coverity findings
1491334: AUTO_CAUSES_COPY due to a for loop using auto& instead of const auto& 1498652: AUTO_CAUSES_COPY due to a for loop using auto& instead of const auto& 1498745: AUTO_CAUSES_COPY due to a for loop using auto& instead of const auto&
This commit is contained in:
parent
f35e337746
commit
31a6ef266a
3 changed files with 3 additions and 3 deletions
|
@ -197,7 +197,7 @@ void merge_top_scope()
|
||||||
|
|
||||||
auto t = pop_scope();
|
auto t = pop_scope();
|
||||||
|
|
||||||
for ( auto v : t->OrderedVars() )
|
for ( const auto& v : t->OrderedVars() )
|
||||||
{
|
{
|
||||||
v->SetOffset(top_scope->Length());
|
v->SetOffset(top_scope->Length());
|
||||||
top_scope->Insert(v->Name(), v);
|
top_scope->Insert(v->Name(), v);
|
||||||
|
|
|
@ -453,7 +453,7 @@ void CPPCompile::GenFinishInit()
|
||||||
|
|
||||||
NL();
|
NL();
|
||||||
int max_cohort = 0;
|
int max_cohort = 0;
|
||||||
for ( auto gi : all_global_info )
|
for ( const auto& gi : all_global_info )
|
||||||
max_cohort = std::max(max_cohort, gi->MaxCohort());
|
max_cohort = std::max(max_cohort, gi->MaxCohort());
|
||||||
|
|
||||||
for ( auto c = 0; c <= max_cohort; ++c )
|
for ( auto c = 0; c <= max_cohort; ++c )
|
||||||
|
|
|
@ -196,7 +196,7 @@ void CPPCompile::InitializeGlobals()
|
||||||
Emit("Frame* f__CPP = nullptr;");
|
Emit("Frame* f__CPP = nullptr;");
|
||||||
NL();
|
NL();
|
||||||
|
|
||||||
for ( auto ginit : IDOptInfo::GetGlobalInitExprs() )
|
for ( const auto& ginit : IDOptInfo::GetGlobalInitExprs() )
|
||||||
{
|
{
|
||||||
auto g = ginit.Id();
|
auto g = ginit.Id();
|
||||||
if ( pfs.Globals().count(g) == 0 )
|
if ( pfs.Globals().count(g) == 0 )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue