Skip to content

Commit

Permalink
Remove full from similar(full(X), T, dims) calls in generic conca…
Browse files Browse the repository at this point in the history
…tenation methods.
  • Loading branch information
Sacha0 committed Jul 28, 2016
1 parent d0a378d commit 90fb27c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,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]
Expand Down Expand Up @@ -919,7 +919,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
Expand Down Expand Up @@ -951,7 +951,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]
Expand Down Expand Up @@ -998,7 +998,7 @@ function cat_t(catdims, typeC::Type, X...)
end
end

C = similar(isa(X[1],AbstractArray) ? full(X[1]) : [X[1]], typeC, tuple(dimsC...))
C = similar(isa(X[1],AbstractArray) ? X[1] : [X[1]], typeC, tuple(dimsC...))
if length(catdims)>1
fill!(C,0)
end
Expand Down Expand Up @@ -1070,7 +1070,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
Expand Down

0 comments on commit 90fb27c

Please sign in to comment.