[poincare] Clean

Change-Id: Ieb154935f5038ccc92a4be86b588736afe5f4c92
This commit is contained in:
Émilie Feral
2017-10-10 16:17:14 +02:00
parent 56fb716a00
commit 2e3e53a6bc

View File

@@ -101,9 +101,7 @@ void Addition::immediateBeautify() {
if (operand(index)->type() == Type::Multiplication && static_cast<const Multiplication *>(operand(index))->operand(0)->type() == Type::Rational && static_cast<const Rational *>(operand(index)->operand(0))->isMinusOne()) {
Multiplication * m = static_cast<Multiplication *>((Expression *)operand(index));
m->removeOperand(m->operand(0), true);
if (m->numberOfOperands() == 1) {
m->replaceWith(const_cast<Expression *>(m->operand(0)), true);
}
m->squashUnaryHierarchy();
const Expression * replacedOperand = operand(index);
if (index == 0) {
const Expression * opOperand[1] = {replacedOperand};