Skip to content

Commit 9663d1a

Browse files
committed
Use reduce(vcat, data) in constructor. Fixes #59
1 parent d1279b3 commit 9663d1a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ComponentArrays"
22
uuid = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
33
authors = ["Jonnie Diegelman <47193959+jonniedie@users.noreply.github.com>"]
4-
version = "0.8.11"
4+
version = "0.8.12"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/componentarray.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ const AdjOrTransComponentArray{T, A} = Union{Adjoint{T, A}, Transpose{T, A}} whe
118118

119119
## Constructor helpers
120120
# For making ComponentArrays from named tuples
121-
make_carray_args(nt) = make_carray_args(Vector, nt) .|> (x->vcat(x...), identity)
121+
function make_carray_args(nt)
122+
data, ax = make_carray_args(Vector, nt)
123+
return (reduce(vcat, data), ax)
124+
end
122125
make_carray_args(T::Type, nt) = make_carray_args(Vector{T}, nt)
123126
function make_carray_args(A::Type{<:AbstractArray}, nt)
124127
data, idx = make_idx([], nt, 0)

0 commit comments

Comments
 (0)