mirror of https://github.com/Icinga/icinga2.git
Remove unnecessary MakeLiteral calls in SetExpression::DoEvaluate
fixes #10199
This commit is contained in:
parent
ca960a0c1a
commit
af5c3b03f8
|
@ -482,41 +482,30 @@ ExpressionResult SetExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint)
|
||||||
if (m_Op != OpSetLiteral) {
|
if (m_Op != OpSetLiteral) {
|
||||||
Value object = VMOps::GetField(parent, index, m_DebugInfo);
|
Value object = VMOps::GetField(parent, index, m_DebugInfo);
|
||||||
|
|
||||||
Expression *lhs = MakeLiteral(object);
|
|
||||||
Expression *rhs = MakeLiteral(operand2);
|
|
||||||
|
|
||||||
switch (m_Op) {
|
switch (m_Op) {
|
||||||
case OpSetAdd:
|
case OpSetAdd:
|
||||||
operand2 = AddExpression(lhs, rhs, m_DebugInfo).Evaluate(frame, dhint);
|
operand2 = object + operand2;
|
||||||
CHECK_RESULT(operand2);
|
|
||||||
break;
|
break;
|
||||||
case OpSetSubtract:
|
case OpSetSubtract:
|
||||||
operand2 = SubtractExpression(lhs, rhs, m_DebugInfo).Evaluate(frame, dhint);
|
operand2 = object - operand2;
|
||||||
CHECK_RESULT(operand2);
|
|
||||||
break;
|
break;
|
||||||
case OpSetMultiply:
|
case OpSetMultiply:
|
||||||
operand2 = MultiplyExpression(lhs, rhs, m_DebugInfo).Evaluate(frame, dhint);
|
operand2 = object * operand2;
|
||||||
CHECK_RESULT(operand2);
|
|
||||||
break;
|
break;
|
||||||
case OpSetDivide:
|
case OpSetDivide:
|
||||||
operand2 = DivideExpression(lhs, rhs, m_DebugInfo).Evaluate(frame, dhint);
|
operand2 = object / operand2;
|
||||||
CHECK_RESULT(operand2);
|
|
||||||
break;
|
break;
|
||||||
case OpSetModulo:
|
case OpSetModulo:
|
||||||
operand2 = ModuloExpression(lhs, rhs, m_DebugInfo).Evaluate(frame, dhint);
|
operand2 = object % operand2;
|
||||||
CHECK_RESULT(operand2);
|
|
||||||
break;
|
break;
|
||||||
case OpSetXor:
|
case OpSetXor:
|
||||||
operand2 = XorExpression(lhs, rhs, m_DebugInfo).Evaluate(frame, dhint);
|
operand2 = object ^ operand2;
|
||||||
CHECK_RESULT(operand2);
|
|
||||||
break;
|
break;
|
||||||
case OpSetBinaryAnd:
|
case OpSetBinaryAnd:
|
||||||
operand2 = BinaryAndExpression(lhs, rhs, m_DebugInfo).Evaluate(frame, dhint);
|
operand2 = object & operand2;
|
||||||
CHECK_RESULT(operand2);
|
|
||||||
break;
|
break;
|
||||||
case OpSetBinaryOr:
|
case OpSetBinaryOr:
|
||||||
operand2 = BinaryOrExpression(lhs, rhs, m_DebugInfo).Evaluate(frame, dhint);
|
operand2 = object | operand2;
|
||||||
CHECK_RESULT(operand2);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
VERIFY(!"Invalid opcode.");
|
VERIFY(!"Invalid opcode.");
|
||||||
|
|
Loading…
Reference in New Issue