From 7ef8d1fb3f1812b342ec917a4b06ea683a1a60ef Mon Sep 17 00:00:00 2001 From: Herman Sletmoen Date: Wed, 28 Aug 2024 22:05:50 +0200 Subject: [PATCH] Don't substitute non-symbolic expressions --- src/variable.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/variable.jl b/src/variable.jl index 95d0727a1..cbfdf74a8 100644 --- a/src/variable.jl +++ b/src/variable.jl @@ -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)