mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +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
|
@ -1053,13 +1053,13 @@ string CPPCompile::GenDirectAssign(const ExprPtr& lhs, const string& rhs_native,
|
|||
if ( n->IsBlank() )
|
||||
return rhs_native;
|
||||
|
||||
auto name = IDNameStr(n);
|
||||
const auto& name = IDNameStr(n);
|
||||
|
||||
string gen;
|
||||
|
||||
if ( n->IsGlobal() ) {
|
||||
const auto& t = n->GetType();
|
||||
auto gn = globals[n->Name()];
|
||||
const auto& gn = globals[n->Name()];
|
||||
|
||||
if ( t->Tag() == TYPE_FUNC && t->AsFuncType()->Flavor() == FUNC_FLAVOR_EVENT ) {
|
||||
gen = string("set_event__CPP(") + gn + ", " + rhs_val_ptr + ", " + gn + "_ev)";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue