Skip to content

Commit 76929d7

Browse files
committed
simpler flow
1 parent 7b44d07 commit 76929d7

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/simplify.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,13 @@ function simplify(x;
3939
Fixpoint(rewriter)
4040
end
4141

42-
if simplify_fractions
43-
f = f (x->has_operation(x, /) ? SymbolicUtils.simplify_fractions(x) : x)
44-
end
45-
46-
PassThrough(f)(x)
42+
x = PassThrough(f)(x)
43+
simplify_fractions && has_operation(x, /) ?
44+
SymbolicUtils.simplify_fractions(x) : x
4745
end
4846

49-
has_operation(x, op) = (istree(x) && operation(x) == op) ||
50-
(istree(x) && any(x->has_operation(x, op), unsorted_arguments(x)))
47+
has_operation(x, op) = (istree(x) && (operation(x) == op ||
48+
any(a->has_operation(a, op),
49+
unsorted_arguments(x))))
5150

5251
Base.@deprecate simplify(x, ctx; kwargs...) simplify(x; rewriter=ctx, kwargs...)

0 commit comments

Comments
 (0)