diff --git a/poincare/src/addition.cpp b/poincare/src/addition.cpp index ea006719d..f7b2e3474 100644 --- a/poincare/src/addition.cpp +++ b/poincare/src/addition.cpp @@ -101,9 +101,7 @@ void Addition::immediateBeautify() { if (operand(index)->type() == Type::Multiplication && static_cast(operand(index))->operand(0)->type() == Type::Rational && static_cast(operand(index)->operand(0))->isMinusOne()) { Multiplication * m = static_cast((Expression *)operand(index)); m->removeOperand(m->operand(0), true); - if (m->numberOfOperands() == 1) { - m->replaceWith(const_cast(m->operand(0)), true); - } + m->squashUnaryHierarchy(); const Expression * replacedOperand = operand(index); if (index == 0) { const Expression * opOperand[1] = {replacedOperand};