[poincare/parametered_expression] Remove redundant assert

This commit is contained in:
Ruben Dashyan
2019-09-13 11:50:48 +02:00
committed by EmilieNumworks
parent 473982c575
commit af64f50a63
2 changed files with 2 additions and 5 deletions

View File

@@ -38,9 +38,6 @@ protected:
ParameteredExpression(const ParameteredExpressionNode * node) : Expression(node) {}
};
static_assert(ParameteredExpression::ParameteredChildIndex() == 0, "ParameteredExpression::replaceUnknown might not be valid");
static_assert(ParameteredExpression::ParameterChildIndex() == 1, "ParameteredExpression::replaceUnknown might not be valid");
}
#endif

View File

@@ -24,8 +24,8 @@ Expression ParameteredExpression::replaceUnknown(const Symbol & symbolToReplace,
/* If the unknown is the parameter, replace the unknown in all children except
* in the parameter and the parametered children */
int childrenCount = numberOfChildren();
assert(ParameteredChildIndex() == 0);
assert(ParameterChildIndex() == 1);
static_assert(ParameteredChildIndex() == 0 && ParameterChildIndex() == 1,
"ParameteredExpression::replaceUnknown might not be valid");
for (int i = 2; i < childrenCount; i++) {
childAtIndex(i).replaceUnknown(symbolToReplace, unknownSymbol);
}