Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -668,21 +668,23 @@ function push!(a::Array{Any,1}, item::ANY)
return a
end

function append!{T}(a::Array{T,1}, items::Vector)
function append!{T}(a::Array{T,1}, items::AbstractVector)
if is(T,None)
error(_grow_none_errmsg)
end
n = length(items)
a === items && (items = copy(items))
ccall(:jl_array_grow_end, Void, (Any, Uint), a, n)
a[end-n+1:end] = items
return a
end

function prepend!{T}(a::Array{T,1}, items::Array{T,1})
function prepend!{T}(a::Array{T,1}, items::AbstractVector)
if is(T,None)
error(_grow_none_errmsg)
end
n = length(items)
a === items && (items = copy(items))
ccall(:jl_array_grow_beg, Void, (Any, Uint), a, n)
a[1:n] = items
return a
Expand Down