Skip to content

Commit c0c6436

Browse files
committed
fixed push!
1 parent 1585846 commit c0c6436

File tree

2 files changed

+486
-0
lines changed

2 files changed

+486
-0
lines changed

src/ModuleElts.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,8 @@ $M(x::Base.Generator;u...)=$M(collect(x);u...)
408408
Base.:+(a::$M,b::$M)=merge(+,a,b)
409409
Base.:-(a::$M)=iszero(a) ? a : $M(k=>-v for(k,v) in a;check=false)
410410

411+
Base.push!(x::$M,p::Pair)=setindex!(x,p[2]+getindex(x,p[1]),p[1])
412+
411413
# multiply module element by scalar
412414
function Base.:*(a::$M{K,V},b)where {K,V}
413415
if iszero(b) || iszero(a)

0 commit comments

Comments
 (0)