Skip to content

Commit 90fb27c

Browse files
committed
Remove full from similar(full(X), T, dims) calls in generic concatenation methods.
1 parent d0a378d commit 90fb27c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

base/abstractarray.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ function typed_vcat{T}(::Type{T}, V::AbstractVector...)
891891
for Vk in V
892892
n += length(Vk)
893893
end
894-
a = similar(full(V[1]), T, n)
894+
a = similar(V[1], T, n)
895895
pos = 1
896896
for k=1:length(V)
897897
Vk = V[k]
@@ -919,7 +919,7 @@ function typed_hcat{T}(::Type{T}, A::AbstractVecOrMat...)
919919
nd = ndims(Aj)
920920
ncols += (nd==2 ? size(Aj,2) : 1)
921921
end
922-
B = similar(full(A[1]), T, nrows, ncols)
922+
B = similar(A[1], T, nrows, ncols)
923923
pos = 1
924924
if dense
925925
for k=1:nargs
@@ -951,7 +951,7 @@ function typed_vcat{T}(::Type{T}, A::AbstractMatrix...)
951951
throw(ArgumentError("number of columns of each array must match (got $(map(x->size(x,2), A)))"))
952952
end
953953
end
954-
B = similar(full(A[1]), T, nrows, ncols)
954+
B = similar(A[1], T, nrows, ncols)
955955
pos = 1
956956
for k=1:nargs
957957
Ak = A[k]
@@ -998,7 +998,7 @@ function cat_t(catdims, typeC::Type, X...)
998998
end
999999
end
10001000

1001-
C = similar(isa(X[1],AbstractArray) ? full(X[1]) : [X[1]], typeC, tuple(dimsC...))
1001+
C = similar(isa(X[1],AbstractArray) ? X[1] : [X[1]], typeC, tuple(dimsC...))
10021002
if length(catdims)>1
10031003
fill!(C,0)
10041004
end
@@ -1070,7 +1070,7 @@ function typed_hvcat{T}(::Type{T}, rows::Tuple{Vararg{Int}}, as::AbstractMatrix.
10701070
a += rows[i]
10711071
end
10721072

1073-
out = similar(full(as[1]), T, nr, nc)
1073+
out = similar(as[1], T, nr, nc)
10741074

10751075
a = 1
10761076
r = 1

0 commit comments

Comments
 (0)