diff --git a/base/array.jl b/base/array.jl index b20fe0f8d17e6..7bf843742a7ca 100644 --- a/base/array.jl +++ b/base/array.jl @@ -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