Skip to content

Commit e42986d

Browse files
authored
Merge pull request #146 from JuliaAlgebra/bl/no_alloc_promote
Change promote_operation to avoid allocation for DynamicPolynomials
2 parents 9a0f7bf + 22a7b8e commit e42986d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/promote.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function MA.promote_operation(
5252
end
5353
function MA.promote_operation(::typeof(*), MT1::Type{<:AbstractMonomialLike},
5454
MT2::Type{<:AbstractMonomialLike})
55-
return typeof(constantmonomial(MT1) * constantmonomial(MT2))
55+
return promote_type(monomialtype(MT1), monomialtype(MT2))
5656
end
5757
function MA.promote_operation(::typeof(*), TT::Type{<:AbstractTermLike{S}},
5858
ST::Type{<:AbstractTermLike{T}}) where {S, T}

0 commit comments

Comments
 (0)