Skip to content

Commit

Permalink
Merge pull request #19800 from ararslan/aa/farewell-collections
Browse files Browse the repository at this point in the history
RFC: Move PriorityQueue and heap functions out of Base
  • Loading branch information
JeffBezanson authored Jan 6, 2017
2 parents 84d9eac + fd2928b commit 5b6ff4a
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 589 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ This section lists changes that do not have deprecation warnings.

* `quadgk` has been moved from Base into a separate package. ([#19741])

* The `Collections` module has been removed, and all functions defined therein have been
moved to the `DataStructures` package. ([#19800])

* The `RepString` type has been moved to the
[LegacyStrings.jl package](https://github.com/JuliaArchive/LegacyStrings.jl).

Expand Down
18 changes: 18 additions & 0 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,24 @@ function append!{T}(a::Array{T,1}, items::AbstractVector)
return a
end

append!(a::Vector, iter) = _append!(a, iteratorsize(iter), iter)

function _append!(a, ::HasLength, iter)
n = length(a)
resize!(a, n+length(iter))
@inbounds for (i,item) in zip(n+1:length(a), iter)
a[i] = item
end
a
end

function _append!(a, ::IteratorSize, iter)
for item in iter
push!(a, item)
end
a
end

"""
prepend!(a::Vector, items) -> collection
Expand Down
Loading

2 comments on commit 5b6ff4a

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

Please sign in to comment.