Skip to content

Commit

Permalink
Merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BioTurboNick committed May 1, 2022
1 parent d1ac01a commit 1b2cf57
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2338,7 +2338,7 @@ function hvncat_fill!(A::Array, row_first::Bool, xs::Tuple)
nrc = nr * nc
na = prod(size(A)[3:end])
k = 1
for d 1:na
@inbounds for d 1:na
dd = nrc * (d - 1)
for i 1:nr
Ai = dd + i
Expand All @@ -2350,7 +2350,7 @@ function hvncat_fill!(A::Array, row_first::Bool, xs::Tuple)
end
end
else
for k eachindex(xs)
@inbounds for k eachindex(xs)
A[k] = xs[k]
end
end
Expand Down Expand Up @@ -2534,34 +2534,6 @@ function _typed_hvncat_shape(::Type{T}, shape::NTuple{N, Tuple}, row_first, as::
return A
end

function hvncat_fill!(A::Array, row_first::Bool, xs::Tuple)
# putting these in separate functions leads to unnecessary allocations
lenxs = length(xs)
lena = length(A)
lenxs == lena || throw(ArgumentError("number of elements doesn't match specified shape"))
if row_first
nr, nc = size(A, 1), size(A, 2)
nrc = nr * nc
na = prod(size(A)[3:end])
k = 1
@inbounds for d 1:na
dd = nrc * (d - 1)
for i 1:nr
Ai = dd + i
for _ 1:nc
A[Ai] = xs[k]
k += 1
Ai += nr
end
end
end
else
@inbounds for k eachindex(xs)
A[k] = xs[k]
end
end
end

function hvncat_fill!(A::AbstractArray{T, N}, scratch1::Vector{Int}, scratch2::Vector{Int},
d1::Int, d2::Int, as::Tuple) where {T, N}
length(scratch1) == length(scratch2) == N ||
Expand Down

0 comments on commit 1b2cf57

Please sign in to comment.