Skip to content

Commit

Permalink
Change promote_operation to avoid allocation for DynamicPolynomials
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Jul 20, 2020
1 parent 9a0f7bf commit 22a7b8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/promote.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function MA.promote_operation(
end
function MA.promote_operation(::typeof(*), MT1::Type{<:AbstractMonomialLike},
MT2::Type{<:AbstractMonomialLike})
return typeof(constantmonomial(MT1) * constantmonomial(MT2))
return promote_type(monomialtype(MT1), monomialtype(MT2))
end
function MA.promote_operation(::typeof(*), TT::Type{<:AbstractTermLike{S}},
ST::Type{<:AbstractTermLike{T}}) where {S, T}
Expand Down

0 comments on commit 22a7b8e

Please sign in to comment.