From ac00f042a36982271862340f157c560910f522c9 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Wed, 5 Jun 2024 18:41:29 -0400 Subject: [PATCH] Revert "Update rewrite-helpers.jl" This reverts commit 9b98a03537c6e6f320baf9dcb58c92fb8c80a2a7. --- src/rewrite-helpers.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rewrite-helpers.jl b/src/rewrite-helpers.jl index 1502070cb..2afc6d4b0 100644 --- a/src/rewrite-helpers.jl +++ b/src/rewrite-helpers.jl @@ -54,8 +54,8 @@ hasnode(Symbolics.is_derivative, X + D(X) + D(X^2)) # returns `true`. function hasnode(r::Function, y::Union{Num, Symbolic}) _hasnode(r, y) end -hasnode(r::Num, y::Union{Num, Symbolic}) = hasnode(unwrap(r), unwrap(y)) -hasnode(r::Symbolic, y::Union{Num, Symbolic}) = hasnode(unwrap(r), unwrap(y)) +hasnode(r::Num, y::Union{Num, Symbolic}) = occursin(unwrap(r), unwrap(y)) +hasnode(r::Symbolic, y::Union{Num, Symbolic}) = occursin(unwrap(r), unwrap(y)) hasnode(r::Union{Num, Symbolic, Function}, y::Number) = false function _hasnode(r, y)