Skip to content

Commit b56cfd5

Browse files
authored
use copyto! slightly better in a constructor (#50)
1 parent 2ac2667 commit b56cfd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/FixedSizeArrays.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ function FixedSizeArray{T,N}(src::AbstractArray{S,N}) where {T,N,S}
112112
# available for all `AbstractArray` types.
113113
size = map(length, axs)
114114
dst = FixedSizeArray{T,N}(undef, size)
115-
copyto!(dst, src)::FixedSizeArray{T,N}
115+
copyto!(dst.mem, src)
116+
dst
116117
end
117118

118119
FixedSizeArray{T}(a::AbstractArray{<:Any,N}) where {T,N} = FixedSizeArray{T,N}(a)

0 commit comments

Comments
 (0)