mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
Fix clang-tidy performance-inefficient-string-concatenation warnings
This commit is contained in:
parent
cb8c35748a
commit
c609d5c90a
7 changed files with 15 additions and 9 deletions
|
@ -28,7 +28,7 @@ string CPPCompile::GenListExpr(const Expr* e, GenType gt, bool nested) {
|
|||
|
||||
if ( nested && e_i->Tag() == EXPR_LIST )
|
||||
// These are table or set indices.
|
||||
gen_i = string("index_val__CPP({") + gen_i + "})";
|
||||
gen_i = util::fmt("index_val__CPP({%s})", gen_i.c_str());
|
||||
|
||||
gen += gen_i;
|
||||
|
||||
|
@ -1196,7 +1196,7 @@ string CPPCompile::GenLambdaClone(const LambdaExpr* l, bool all_deep) {
|
|||
if ( captures && ! IsNativeType(id_t) ) {
|
||||
for ( const auto& c : *captures )
|
||||
if ( id == c.Id() && (c.IsDeepCopy() || all_deep) )
|
||||
arg = string("cast_intrusive<") + TypeName(id_t) + ">(" + arg + "->Clone())";
|
||||
arg = util::fmt("cast_intrusive<%s>(%s->Clone())", TypeName(id_t), arg.c_str());
|
||||
}
|
||||
|
||||
cl_args += ", " + arg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue