Use properly-sized loop variables or convert to ranged-for (bugprone-too-small-loop-variable)

This commit is contained in:
Tim Wojtulewicz 2020-02-12 14:56:56 -08:00
parent 94c4c85e82
commit 1248411a2f
22 changed files with 89 additions and 95 deletions

View file

@ -208,9 +208,9 @@ TraversalCode Func::Traverse(TraversalCallback* cb) const
tc = scope->Traverse(cb);
HANDLE_TC_STMT_PRE(tc);
for ( unsigned int i = 0; i < bodies.size(); ++i )
for ( const auto& body : bodies )
{
tc = bodies[i].stmts->Traverse(cb);
tc = body.stmts->Traverse(cb);
HANDLE_TC_STMT_PRE(tc);
}
}
@ -587,10 +587,10 @@ void ScriptFunc::Describe(ODesc* d) const
d->NL();
d->AddCount(frame_size);
for ( unsigned int i = 0; i < bodies.size(); ++i )
for ( const auto& body : bodies )
{
bodies[i].stmts->AccessStats(d);
bodies[i].stmts->Describe(d);
body.stmts->AccessStats(d);
body.stmts->Describe(d);
}
}