Skip to content

Commit

Permalink
Remove unnecessary Symbolics.
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Oct 19, 2022
1 parent c049454 commit d5983bb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/inputoutput.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,17 @@ function same_or_inner_namespace(u, var)
nv = get_namespace(var)
nu == nv || # namespaces are the same
startswith(nv, nu) || # or nv starts with nu, i.e., nv is an inner namepsace to nu
occursin('', string(Symbolics.getname(var))) &&
!occursin('', string(Symbolics.getname(u))) # or u is top level but var is internal
occursin('', string(getname(var))) &&
!occursin('', string(getname(u))) # or u is top level but var is internal
end

function inner_namespace(u, var)
nu = get_namespace(u)
nv = get_namespace(var)
nu == nv && return false
startswith(nv, nu) || # or nv starts with nu, i.e., nv is an inner namepsace to nu
occursin('', string(Symbolics.getname(var))) &&
!occursin('', string(Symbolics.getname(u))) # or u is top level but var is internal
occursin('', string(getname(var))) &&
!occursin('', string(getname(u))) # or u is top level but var is internal
end

"""
Expand All @@ -138,7 +138,7 @@ end
Return the namespace of a variable as a string. If the variable is not namespaced, the string is empty.
"""
function get_namespace(x)
sname = string(Symbolics.getname(x))
sname = string(getname(x))
parts = split(sname, '')
if length(parts) == 1
return ""
Expand Down

0 comments on commit d5983bb

Please sign in to comment.