mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Use const auto references to avoid some copies
This commit is contained in:
parent
739efc79be
commit
f7495831a2
5 changed files with 8 additions and 8 deletions
|
@ -128,7 +128,7 @@ void CPPCompile::DeclareSubclass(const FuncTypePtr& ft, const ProfileFunc* pf, c
|
|||
|
||||
if ( lambda_ids ) {
|
||||
for ( auto& id : *lambda_ids ) {
|
||||
auto name = lambda_names[id];
|
||||
const auto& name = lambda_names[id];
|
||||
auto tn = FullTypeName(id->GetType());
|
||||
addl_args = addl_args + ", " + tn + " _" + name;
|
||||
|
||||
|
@ -202,7 +202,7 @@ void CPPCompile::BuildLambda(const FuncTypePtr& ft, const ProfileFunc* pf, const
|
|||
const LambdaExpr* l, const IDPList* lambda_ids) {
|
||||
// Declare the member variables for holding the captures.
|
||||
for ( auto& id : *lambda_ids ) {
|
||||
auto name = lambda_names[id];
|
||||
const auto& name = lambda_names[id];
|
||||
auto tn = FullTypeName(id->GetType());
|
||||
Emit("%s %s;", tn, name);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue