Skip to content

Commit 7869ebf

Browse files
committed
formatting
1 parent a93451b commit 7869ebf

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

src/chainvec.jl

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,30 @@ to information stored in a single sample.
1111
"""
1212
function chainvec end
1313

14-
15-
function chainvec(nt::NamedTuple, n=1)
16-
tv = TupleVector(undef, nt, n)
17-
@inbounds tv[1] = nt
18-
return tv
14+
function chainvec(nt::NamedTuple, n = 1)
15+
tv = TupleVector(undef, nt, n)
16+
@inbounds tv[1] = nt
17+
return tv
1918
end
2019

21-
function chainvec(x::T, n=1) where {T<:Real}
22-
ev = ElasticVector{T}(undef, n)
23-
@inbounds ev[1] = x
24-
return ev
20+
function chainvec(x::T, n = 1) where {T<:Real}
21+
ev = ElasticVector{T}(undef, n)
22+
@inbounds ev[1] = x
23+
return ev
2524
end
2625

27-
function chainvec(x::T, n=1) where {T}
28-
if isstructtype(T)
29-
v = StructArrays.replace_storage(ElasticVector, StructVector{T}(undef, n))
30-
@inbounds v[1] = x
31-
return v
32-
end
33-
ev = ElasticVector{T}(undef, n)
34-
@inbounds ev[1] = x
35-
return ev
26+
function chainvec(x::T, n = 1) where {T}
27+
if isstructtype(T)
28+
v = StructArrays.replace_storage(ElasticVector, StructVector{T}(undef, n))
29+
@inbounds v[1] = x
30+
return v
31+
end
32+
@inbounds ev[1] = x
33+
return ev
3634
end
3735

38-
function chainvec(x::DenseArray{T,N}, n=1) where {T,N}
39-
nv = nestedview(ElasticArray{T,N+1}(undef, size(x)..., n), N)
40-
@inbounds nv[1] = x
41-
return nv
42-
end
36+
function chainvec(x::DenseArray{T,N}, n = 1) where {T,N}
37+
nv = nestedview(ElasticArray{T,N + 1}(undef, size(x)..., n), N)
38+
@inbounds nv[1] = x
39+
return nv
40+
end

0 commit comments

Comments
 (0)