mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[poincare/unit_convert] Fix improper reduction
In UnitConvert::shallowBeautify, an orphan expression would be reduced without reaffecting the reduction's result. The reduction not being taken into account would cause problem when handling undef values. ex : Try to calculate i->_min Change-Id: I4e53afa40ba838fed8c2fba9944c9c9ed1dc95b4
This commit is contained in:
committed by
Émilie Feral
parent
1995781a9f
commit
d917b2e1c9
@@ -94,7 +94,7 @@ Expression UnitConvert::shallowBeautify(ExpressionNode::ReductionContext reducti
|
||||
}
|
||||
Expression result = Multiplication::Builder(division, unit);
|
||||
replaceWithInPlace(result);
|
||||
result.shallowReduce(reductionContextWithoutUnits);
|
||||
result = result.shallowReduce(reductionContextWithoutUnits);
|
||||
return result.shallowBeautify(reductionContextWithoutUnits);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user