Skip to content

Commit f1e6492

Browse files
Fix occursin
1 parent b959fd8 commit f1e6492

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/substitute.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,14 @@ Base.occursin(needle, haystack::Symbolic) = _occursin(needle, haystack)
5151
Base.occursin(needle::Symbolic, haystack) = _occursin(needle, haystack)
5252
function _occursin(needle, haystack)
5353
isequal(needle, haystack) && return true
54-
5554
if iscall(haystack)
5655
args = arguments(haystack)
5756
for arg in args
58-
occursin(needle, arg) && return true
57+
if arg isa Integer || arg isa AbstractFloat
58+
isequal(arg, haystack)
59+
else
60+
occursin(needle, arg) && return true
61+
end
5962
end
6063
end
6164
return false

0 commit comments

Comments
 (0)