diff --git a/apps/shared/storage_expression_model.cpp b/apps/shared/storage_expression_model.cpp index 39849c688..678ea5f30 100644 --- a/apps/shared/storage_expression_model.cpp +++ b/apps/shared/storage_expression_model.cpp @@ -30,7 +30,7 @@ void StorageExpressionModel::text(char * buffer, size_t bufferSize) const { bool StorageExpressionModel::isCircularlyDefined(Poincare::Context * context) const { if (m_circular == -1) { - m_circular = Expression::ExpressionWithoutSymbols(expressionReduced(context), *context).isUninitialized(); + m_circular = Expression::ExpressionWithoutSymbols(expressionClone(), *context).isUninitialized(); } return m_circular; } diff --git a/poincare/include/poincare/expression.h b/poincare/include/poincare/expression.h index 57cdc0081..db8454bfd 100644 --- a/poincare/include/poincare/expression.h +++ b/poincare/include/poincare/expression.h @@ -247,7 +247,6 @@ protected: int getPolynomialCoefficients(Context & context, const char * symbolName, Expression coefficients[]) const { return node()->getPolynomialCoefficients(context, symbolName, coefficients); } bool hasReplaceableSymbols(Context & context) const; Expression shallowReplaceReplaceableSymbols(Context & context) { return node()->shallowReplaceReplaceableSymbols(context); } - Expression defaultReplaceReplaceableSymbols(Context & context); /* Simplification */ Expression denominator(Context & context, Preferences::AngleUnit angleUnit) const { return node()->denominator(context, angleUnit); } diff --git a/poincare/src/expression.cpp b/poincare/src/expression.cpp index bc778b8c9..76ebd4a95 100644 --- a/poincare/src/expression.cpp +++ b/poincare/src/expression.cpp @@ -238,14 +238,6 @@ bool Expression::hasReplaceableSymbols(Context & context) const { }, context, false); } -Expression Expression::defaultReplaceReplaceableSymbols(Context & context) { - int nbChildren = numberOfChildren(); - for (int i = 0; i < nbChildren; i++) { - childAtIndex(i).shallowReplaceReplaceableSymbols(context); - } - return *this; -} - template Evaluation Expression::approximateToEvaluation(Context& context, Preferences::AngleUnit angleUnit) const { return node()->approximate(U(), context, angleUnit); diff --git a/poincare/src/expression_node.cpp b/poincare/src/expression_node.cpp index 97719c681..e2fd711df 100644 --- a/poincare/src/expression_node.cpp +++ b/poincare/src/expression_node.cpp @@ -28,7 +28,7 @@ int ExpressionNode::getPolynomialCoefficients(Context & context, const char * sy } Expression ExpressionNode::shallowReplaceReplaceableSymbols(Context & context) { - return Expression(this).defaultReplaceReplaceableSymbols(context); + return Expression(this); } int ExpressionNode::getVariables(Context & context, isVariableTest isVariable, char * variables, int maxSizeVariable) const {