mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Avoid extra temporary strings in concatenation
This commit is contained in:
parent
f7495831a2
commit
5c47533653
1 changed files with 9 additions and 2 deletions
|
@ -130,9 +130,16 @@ void CPPCompile::DeclareSubclass(const FuncTypePtr& ft, const ProfileFunc* pf, c
|
|||
for ( auto& id : *lambda_ids ) {
|
||||
const auto& name = lambda_names[id];
|
||||
auto tn = FullTypeName(id->GetType());
|
||||
addl_args = addl_args + ", " + tn + " _" + name;
|
||||
addl_args += ", ";
|
||||
addl_args += tn;
|
||||
addl_args += " _";
|
||||
addl_args += name;
|
||||
|
||||
inits = inits + ", " + name + "(std::move(_" + name + "))";
|
||||
inits += ", ";
|
||||
inits += name;
|
||||
inits += "(std::move(_";
|
||||
inits += name;
|
||||
inits += "))";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue