Skip to content

Commit b0ae001

Browse files
committed
Remove specialized broadcast!{T,S,N}(::typeof(identity), ::AbstractArray{T,N}, ::AbstractArray{S,N})
1 parent dbff9fd commit b0ae001

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

base/broadcast.jl

-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ typealias ScalarType Union{Type{Any}, Type{Nullable}}
1919
# special cases for "X .= ..." (broadcast!) assignments
2020
broadcast!(::typeof(identity), X::AbstractArray, x::Number) = fill!(X, x)
2121
broadcast!(f, X::AbstractArray, x::Number...) = (@inbounds for I in eachindex(X); X[I] = f(x...); end; X)
22-
function broadcast!{T,S,N}(::typeof(identity), x::AbstractArray{T,N}, y::AbstractArray{S,N})
23-
@boundscheck check_broadcast_shape(broadcast_indices(x), broadcast_indices(y))
24-
copy!(x, y)
25-
end
2622

2723
# logic for deciding the resulting container type
2824
containertype(x) = containertype(typeof(x))

base/sparse/higherorderfns.jl

-3
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,6 @@ ambiguityfunnel{Tf}(f::Tf, x, y) = _aresameshape(x, y) ? _noshapecheck_map(f, x,
148148
broadcast(::typeof(+), x::SparseVector, y::SparseVector) = ambiguityfunnel(+, x, y) # base/sparse/sparsevectors.jl:1266
149149
broadcast(::typeof(-), x::SparseVector, y::SparseVector) = ambiguityfunnel(-, x, y) # base/sparse/sparsevectors.jl:1266
150150
broadcast(::typeof(*), x::SparseVector, y::SparseVector) = ambiguityfunnel(*, x, y) # base/sparse/sparsevectors.jl:1266
151-
function broadcast!(::typeof(identity), C::SparseMatrixCSC, A::SparseMatrixCSC) # from #17623, loc?
152-
_checksameshape(C, A); return copy!(C, A)
153-
end
154151

155152

156153
# (4) _map_zeropres!/_map_notzeropres! specialized for a single sparse vector/matrix

test/sparse/higherorderfns.jl

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ end
8686
@test broadcast(sin, A) == sparse(broadcast(sin, fA))
8787
@test broadcast!(sin, copy(a), a) == sparse(broadcast!(sin, copy(fa), fa))
8888
@test broadcast!(sin, copy(A), A) == sparse(broadcast!(sin, copy(fA), fA))
89+
@test broadcast!(identity, copy(a), a) == sparse(broadcast!(identity, copy(fa), fa))
90+
@test broadcast!(identity, copy(A), A) == sparse(broadcast!(identity, copy(fA), fA))
8991
end
9092

9193
@testset "broadcast[!] implementation specialized for pairs of (input) sparse vectors/matrices" begin

0 commit comments

Comments
 (0)