Skip to content

Commit

Permalink
Remove Compat.collect(A)
Browse files Browse the repository at this point in the history
Was added in #350 and #351, now obsolete as no longer required on 
minimum supported Julia version 0.6.
  • Loading branch information
martinholters committed Aug 27, 2018
1 parent ba2b5b7 commit cfce90c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ Please check the list below for the specific syntax you need.

Currently, the `@compat` macro supports the following syntaxes:

* `Compat.collect(A)` returns an `Array`, no matter what indices the array `A` has. [#21257]

* `@compat foo(::CartesianRange{N})` to replace the former
`foo(::CartesianRange{CartesianIndex{N}})` ([#20974]). Note that
`CartesianRange` now has two type parameters, so using them as
Expand Down Expand Up @@ -524,7 +522,6 @@ includes this fix. Find the minimum version from there.
[#20407]: https://github.com/JuliaLang/julia/issues/20407
[#20974]: https://github.com/JuliaLang/julia/issues/20974
[#21197]: https://github.com/JuliaLang/julia/issues/21197
[#21257]: https://github.com/JuliaLang/julia/issues/21257
[#21346]: https://github.com/JuliaLang/julia/issues/21346
[#21709]: https://github.com/JuliaLang/julia/issues/21709
[#22064]: https://github.com/JuliaLang/julia/issues/22064
Expand Down
14 changes: 0 additions & 14 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -326,20 +326,6 @@ else
end
end

# https://github.com/JuliaLang/julia/pull/21257
@static if VERSION < v"0.6.0-pre.beta.28"
collect(A) = collect_indices(indices(A), A)
collect_indices(::Tuple{}, A) = copy!(Array{eltype(A)}(), A)
collect_indices(indsA::Tuple{Vararg{Base.OneTo}}, A) =
copy!(Array{eltype(A)}(map(length, indsA)), A)
function collect_indices(indsA, A)
B = Array{eltype(A)}(map(length, indsA))
copy!(B, CartesianRange(indices(B)), A, CartesianRange(indsA))
end
else
const collect = Base.collect
end

# https://github.com/JuliaLang/julia/pull/21197
if VERSION < v"0.7.0-DEV.257"
# allow the elements of the Cmd to be accessed as an array or iterator
Expand Down
12 changes: 0 additions & 12 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,6 @@ using Compat: StringVector
@test length(StringVector(5)) == 5
@test String(fill!(StringVector(5), 0x61)) == "aaaaa"

# collect
if VERSION < v"0.7.0-"
# Note: This is disabled on 0.7, since the Compat.collect functionality is only
# applicable on 0.5, and OffsetArrays currently has some incompatibilities with
# 0.7. This can be reenabled later if needed.
using OffsetArrays
a = OffsetArray(1:3, -1:1)
b = Compat.collect(a)
@test indices(b) === (Base.OneTo(3),)
@test b == [1,2,3]
end

# PR 22064
module Test22064
using Compat
Expand Down

0 comments on commit cfce90c

Please sign in to comment.