From 2e3e53a6bc62d21b4e4e9c2b8cb77848b8804249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 10 Oct 2017 16:17:14 +0200 Subject: [PATCH] [poincare] Clean Change-Id: Ieb154935f5038ccc92a4be86b588736afe5f4c92 --- poincare/src/addition.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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};