Skip to content

Commit

Permalink
Comment on why we use vcat
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Feb 14, 2020
1 parent b665233 commit 3db20ef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3db20ef

Please sign in to comment.