Skip to content

Commit

Permalink
Avoid applying hash consing twice
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenszhu committed Nov 14, 2024
1 parent 3dc1169 commit c8b2f66
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,7 @@ function Term{T}(f, args; kw...) where T
end

function Term(f, args; metadata=NO_METADATA)
s = Term{_promote_symtype(f, args)}(f, args, metadata=metadata)
BasicSymbolic(s)
Term{_promote_symtype(f, args)}(f, args, metadata=metadata)
end

function Add(::Type{T}, coeff, dict; metadata=NO_METADATA, kw...) where T
Expand Down Expand Up @@ -508,8 +507,7 @@ function Div{T}(n, d, simplified=false; metadata=nothing) where {T}
end

function Div(n,d, simplified=false; kw...)
s = Div{promote_symtype((/), symtype(n), symtype(d))}(n, d, simplified; kw...)
BasicSymbolic(s)
Div{promote_symtype((/), symtype(n), symtype(d))}(n, d, simplified; kw...)
end

@inline function numerators(x)
Expand Down

0 comments on commit c8b2f66

Please sign in to comment.