From a0c1b21c0c68e9621b144b35bfe7e8b05914d243 Mon Sep 17 00:00:00 2001 From: Fengyang Wang Date: Tue, 12 Sep 2017 16:55:03 -0400 Subject: [PATCH] Update sumindex.jl (#115) https://github.com/JuliaLang/julia/pull/22825 will change the behavior of `mapreduce` to never promote, so to retain the previous behavior it must be changed to `sum`. --- src/array/sumindex.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/array/sumindex.jl b/src/array/sumindex.jl index 961f68cb..aef7ca86 100644 --- a/src/array/sumindex.jl +++ b/src/array/sumindex.jl @@ -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