mirror of https://github.com/Icinga/icinga2.git
Merge pull request #5819 from Icinga/feature/avoid-func-call-allocations
Avoid unnecessary allocations in the FunctionCallExpression class
This commit is contained in:
commit
c6e36723d5
|
@ -428,6 +428,7 @@ ExpressionResult FunctionCallExpression::DoEvaluate(ScriptFrame& frame, DebugHin
|
|||
|
||||
if (vfunc.IsObjectType<Type>()) {
|
||||
std::vector<Value> arguments;
|
||||
arguments.reserve(m_Args.size());
|
||||
for (Expression *arg : m_Args) {
|
||||
ExpressionResult argres = arg->Evaluate(frame);
|
||||
CHECK_RESULT(argres);
|
||||
|
@ -447,6 +448,7 @@ ExpressionResult FunctionCallExpression::DoEvaluate(ScriptFrame& frame, DebugHin
|
|||
BOOST_THROW_EXCEPTION(ScriptError("Function is not marked as safe for sandbox mode.", m_DebugInfo));
|
||||
|
||||
std::vector<Value> arguments;
|
||||
arguments.reserve(m_Args.size());
|
||||
for (Expression *arg : m_Args) {
|
||||
ExpressionResult argres = arg->Evaluate(frame);
|
||||
CHECK_RESULT(argres);
|
||||
|
|
Loading…
Reference in New Issue