diff --git a/src/utils.jl b/src/utils.jl index f067a14c6..14a1e9917 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -128,7 +128,7 @@ function diff2term(O, O_metadata::Union{Dict, Nothing, Base.ImmutableDict}=nothi opname = string(tosymbol(args[1]), "[", map(tosymbol, args[2:end])..., "]") return Sym{symtype(O)}(Symbol(opname, d_separator, ds)) end - newname = occursin(d_separator, opname) ? Symbol(opname, ds) : Symbol(opname, d_separator, ds) + newname = hasnode(d_separator, opname) ? Symbol(opname, ds) : Symbol(opname, d_separator, ds) return setname(maketerm(typeof(O), rename(oldop, newname), children(O), symtype(O), O_metadata isa Nothing ? metadata(O) : Base.ImmutableDict(metadata(O)..., O_metadata...)), newname) end