[poincare/expression] defaultDeepReduceChildren does not recompute the number of children

This commit is contained in:
Ruben Dashyan
2020-01-23 15:26:04 +01:00
committed by Léa Saviot
parent 8f31f56544
commit f9e419dcd6

View File

@@ -312,7 +312,9 @@ Expression Expression::addMissingParentheses() {
}
void Expression::defaultDeepReduceChildren(ExpressionNode::ReductionContext reductionContext) {
for (int i = 0; i < numberOfChildren(); i++) {
const int childrenCount = numberOfChildren();
for (int i = 0; i < childrenCount; i++) {
assert(childrenCount == numberOfChildren());
childAtIndex(i).deepReduce(reductionContext);
}
}