From 3db20efb479420c44ffef26e4a846ad92cde6cb5 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 13 Feb 2020 22:40:50 -0800 Subject: [PATCH] Comment on why we use `vcat` --- src/mapreduce.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mapreduce.jl b/src/mapreduce.jl index b27a62ff..7732b08f 100644 --- a/src/mapreduce.jl +++ b/src/mapreduce.jl @@ -309,6 +309,8 @@ _valof(::Val{D}) where D = D (init = (similar_type(a, Union{}, Size(0))(), init),), ) do (ys, acc), x y = rf(acc, x) + # Not using `push(ys, y)` here since we need to widen element type as + # we iterate. (vcat(ys, SA[y]), y) end dims === (:) && return first(results)