Skip to content

Commit

Permalink
Don't substitute non-symbolic expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
hersle committed Aug 28, 2024
1 parent a120309 commit 7ef8d1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,9 @@ function fast_substitute(expr, pair::Pair; operator = Nothing)
symtype(expr),
metadata(expr))
end
function fast_substitute(expr::Number, args...; kwargs...)
return expr # unnecessary to substitute non-symbolic expressions
end

function getparent(x, val=_fail)
maybe_parent = getmetadata(x, Symbolics.GetindexParent, nothing)
Expand Down

0 comments on commit 7ef8d1f

Please sign in to comment.