mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-22 23:30:37 +01:00
[poincare] Remove unneeded tree copy
This commit is contained in:
@@ -223,9 +223,8 @@ Expression Addition::shallowReduce(Context& context, Preferences::AngleUnit angl
|
||||
int i = 0;
|
||||
int initialNumberOfOperands = thisCopy.numberOfChildren();
|
||||
while (i < initialNumberOfOperands) {
|
||||
Expression c = thisCopy.childAtIndex(i);
|
||||
if (c.type() == ExpressionNode::Type::Addition) {
|
||||
thisCopy.mergeChildrenAtIndexInPlace(thisCopy.childAtIndex(i), i);
|
||||
if (thisCopy.childAtIndex(i).type() == ExpressionNode::Type::Addition) {
|
||||
thisCopy.mergeChildrenAtIndexInPlace(thisCopy.childAtIndex(i), i); // The tree is passed by reference
|
||||
continue;
|
||||
}
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user