From c9bd8070cfb0ed79b4031b168d95fb210029c19b Mon Sep 17 00:00:00 2001 From: Sacha Verweij Date: Wed, 27 Jul 2016 17:09:59 -0700 Subject: [PATCH] Remove `full` from `similar(full(X), T, dims)` calls in generic concatenation methods. --- base/abstractarray.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 581ae99e0562b..abd6772288d96 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -1014,7 +1014,7 @@ function typed_vcat{T}(::Type{T}, V::AbstractVector...) for Vk in V n += length(Vk) end - a = similar(full(V[1]), T, n) + a = similar(V[1], T, n) pos = 1 for k=1:length(V) Vk = V[k] @@ -1042,7 +1042,7 @@ function typed_hcat{T}(::Type{T}, A::AbstractVecOrMat...) nd = ndims(Aj) ncols += (nd==2 ? size(Aj,2) : 1) end - B = similar(full(A[1]), T, nrows, ncols) + B = similar(A[1], T, nrows, ncols) pos = 1 if dense for k=1:nargs @@ -1074,7 +1074,7 @@ function typed_vcat{T}(::Type{T}, A::AbstractMatrix...) throw(ArgumentError("number of columns of each array must match (got $(map(x->size(x,2), A)))")) end end - B = similar(full(A[1]), T, nrows, ncols) + B = similar(A[1], T, nrows, ncols) pos = 1 for k=1:nargs Ak = A[k] @@ -1303,7 +1303,7 @@ function typed_hvcat{T}(::Type{T}, rows::Tuple{Vararg{Int}}, as::AbstractMatrix. a += rows[i] end - out = similar(full(as[1]), T, nr, nc) + out = similar(as[1], T, nr, nc) a = 1 r = 1