Skip to content

Commit

Permalink
Remove generated function broadcast_tup
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloferz committed Sep 19, 2016
1 parent 2193638 commit fff39b7
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 fff39b7

Please sign in to comment.