Skip to content

Commit

Permalink
Merge pull request JuliaLang#116 from iamed2/master
Browse files Browse the repository at this point in the history
Update AbstractDataVector append! to allow appending to itself
  • Loading branch information
johnmyleswhite committed Sep 2, 2014
2 parents fd41d17 + 3572960 commit 83dbf36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/datavector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ Base.deleteat!(pdv::PooledDataVector, inds) = (deleteat!(pdv.refs, inds); pdv)

function Base.append!(da::AbstractDataVector, items::AbstractVector)
oldn = length(da)
resize!(da, oldn+length(items))
da[oldn+1:end] = items
itn = length(items)
resize!(da, oldn+itn)
da[oldn+1:end] = items[1:itn]
da
end

Expand Down

0 comments on commit 83dbf36

Please sign in to comment.