Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
fintarin committed Jul 13, 2023
1 parent 76f6f38 commit 1b65261
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
33 changes: 0 additions & 33 deletions src/fintamath/expressions/binary/DivExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,6 @@ ArgumentPtr DivExpression::nestedRationalsSimplify(const IFunction & /*func*/, c
}
}

if (const auto &rhsExpr = cast<IExpression>(rhs)) {
if (is<Mul>(rhsExpr->getFunction())) {
if (auto res = nestedRationalsInDenominatorSimplify(lhs, rhsExpr->getChildren())) {
return res;
}
}
}

return {};
}

Expand Down Expand Up @@ -526,29 +518,4 @@ ArgumentPtr DivExpression::nestedRationalsInNumeratorSimplify(const ArgumentsPtr
return {};
}

ArgumentPtr DivExpression::nestedRationalsInDenominatorSimplify(const ArgumentPtr &lhs,
const ArgumentsPtrVector &rhsChildren) {
ArgumentsPtrVector numeratorChildren;
ArgumentsPtrVector denominatorChildren;

for (const auto &child : rhsChildren) {
if (const auto &rationalChild = cast<Rational>(child)) {
numeratorChildren.emplace_back(rationalChild->denominator().clone());
denominatorChildren.emplace_back(rationalChild->numerator().clone());
continue;
}

denominatorChildren.emplace_back(child);
}

if (!numeratorChildren.empty()) {
numeratorChildren.emplace_back(lhs);

ArgumentPtr numerator = makeExpr(Mul(), numeratorChildren);
ArgumentPtr denominator = makeExpr(Mul(), denominatorChildren);
return makeExpr(Div(), numerator, denominator);
}

return {};
}
}
3 changes: 0 additions & 3 deletions src/fintamath/expressions/binary/DivExpression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ class DivExpression : public IBinaryExpressionCRTP<DivExpression> {

static ArgumentPtr nestedRationalsInNumeratorSimplify(const ArgumentsPtrVector &lhsChildren, const ArgumentPtr &rhs);

static ArgumentPtr nestedRationalsInDenominatorSimplify(const ArgumentPtr &lhs,
const ArgumentsPtrVector &rhsChildren);

static std::pair<ArgumentPtr, ArgumentPtr> sumSumSimplify(const ArgumentPtr &lhs, const ArgumentPtr &rhs);

static std::pair<ArgumentPtr, ArgumentPtr> sumMulSimplify(const ArgumentPtr &lhs, const ArgumentPtr &rhs);
Expand Down

0 comments on commit 1b65261

Please sign in to comment.