mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare] GreatCommonDivisor: avoid copy when possible
This commit is contained in:
@@ -69,7 +69,7 @@ Expression GreatCommonDivisor::shallowReduce(Context& context, Preferences::Angl
|
||||
}
|
||||
}
|
||||
if (c1.type() == ExpressionNode::Type::Rational) {
|
||||
Rational r1 = static_cast<Rational>(c1);
|
||||
Rational r1 = static_cast<Rational&>(c1);
|
||||
if (!r1.integerDenominator().isOne()) {
|
||||
return Undefined();
|
||||
}
|
||||
@@ -77,8 +77,8 @@ Expression GreatCommonDivisor::shallowReduce(Context& context, Preferences::Angl
|
||||
if (c0.type() != ExpressionNode::Type::Rational || c1.type() != ExpressionNode::Type::Rational) {
|
||||
return *this;
|
||||
}
|
||||
Rational r0 = static_cast<Rational>(c0);
|
||||
Rational r1 = static_cast<Rational>(c1);
|
||||
Rational r0 = static_cast<Rational&>(c0);
|
||||
Rational r1 = static_cast<Rational&>(c1);
|
||||
|
||||
Integer a = r0.signedIntegerNumerator();
|
||||
Integer b = r1.signedIntegerNumerator();
|
||||
|
||||
Reference in New Issue
Block a user