Skip to content

Commit

Permalink
Merge pull request #18580 from pabloferz/pz/broadcast_tup
Browse files Browse the repository at this point in the history
Fix #18577, remove generated function `broadcast_tup`
  • Loading branch information
vtjnash authored Sep 19, 2016
2 parents 2193638 + fff39b7 commit 6cde412
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,11 @@ end

@inline broadcast_t(f, T, As...) = broadcast!(f, similar(Array{T}, broadcast_indices(As...)), As...)

@generated function broadcast_tup{AT,nargs}(f, As::AT, ::Type{Val{nargs}}, n)
quote
ntuple(n -> (@ncall $nargs f i->_broadcast_getindex(As[i], n)), Val{n})
end
end

function broadcast_c(f, ::Type{Tuple}, As...)
shape = broadcast_indices(As...)
check_broadcast_indices(shape, As...)
n = length(shape[1])
nargs = length(As)
return broadcast_tup(f, As, Val{nargs}, n)
return ntuple(k->f((_broadcast_getindex(A, k) for A in As)...), n)
end
@inline broadcast_c(f, ::Type{Any}, a...) = f(a...)
@inline broadcast_c(f, ::Type{Array}, As...) = broadcast_t(f, promote_eltype_op(f, As...), As...)
Expand Down

0 comments on commit 6cde412

Please sign in to comment.