Skip to content

Commit

Permalink
Update sumindex.jl
Browse files Browse the repository at this point in the history
JuliaLang/julia#22825 will change the behavior of `mapreduce` to never promote, so to retain the previous behavior it must be changed to `sum`.
  • Loading branch information
TotalVerb authored Sep 10, 2017
1 parent cb1b377 commit acec604
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/array/sumindex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ end

function setup_mapr_access(A)
z = zero(eltype(A))
zz = mapreduce(z -> z*z, +, [z]) # z = z*z, with any promotion from mapreduce
zz = sum(z -> z * z, [z]) # z = z*z, with any promotion from sum
n = minimum(size(A))
B = Vector{typeof(zz)}(n)
B, zz, n
Expand Down

0 comments on commit acec604

Please sign in to comment.