Skip to content

Commit 4a6a23e

Browse files
fix: only CSE arrays of symbolics inside expressions
1 parent 9ee6baf commit 4a6a23e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/code.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,8 @@ function cse!(expr::Symbolic, state::CSEState)
857857
args = arguments(expr)
858858
cse_inside_expr(expr, op, args...) || return expr
859859
args = map(args) do arg
860-
if arg isa Union{Tuple, AbstractArray}
860+
if arg isa Union{Tuple, AbstractArray} &&
861+
(_is_array_of_symbolics(arg) || _is_tuple_of_symbolics(arg))
861862
if arg isa Tuple
862863
new_arg = cse!(MakeTuple(arg), state)
863864
sym = newsym(Tuple{symtype.(arg)...})

0 commit comments

Comments
 (0)