Skip to content

Commit

Permalink
Drop compat code for indexin from #515
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 8, 2019
1 parent 1da4921 commit 9d7f3f4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 20 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ Currently, the `@compat` macro supports the following syntaxes:

* `findin(a, b)` is now `findall(in(b), a)` ([#24673]).

* `Compat.indexin` accepts any iterable as first argument, returns `nothing` (rather than `0`)
for entries with no match and gives the index of the first (rather than the last) match
([#25662], [#25998]).

* `isupper`, `islower`, `ucfirst` and `lcfirst` are now `isuppercase`, `islowercase`,
`uppercasefirst` and `lowercasefirst` ([#26442]).

Expand Down
13 changes: 0 additions & 13 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,6 @@ end
end
end

if VERSION < v"0.7.0-DEV.3972"
function indexin(a, b::AbstractArray)
inds = keys(b)
bdict = Dict{eltype(b),eltype(inds)}()
for (val, ind) in zip(b, inds)
get!(bdict, val, ind)
end
return Union{eltype(inds), Nothing}[
get(bdict, i, nothing) for i in a
]
end
end

if VERSION < v"0.7.0-DEV.4585"
export isuppercase, islowercase, uppercasefirst, lowercasefirst
const isuppercase = isupper
Expand Down
3 changes: 3 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -856,3 +856,6 @@ mktempdir(@__DIR__) do dir
end
@test readdir(dir) == ["dest.jl"]
end

# 0.7.0-DEV.3972
@test Compat.indexin([1, 2], [1, 0, 1]) == [1, nothing]
3 changes: 0 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ if VERSION < v"0.7.0-DEV.4592"
@test findall(occursin([1, 2]), [1]) == [1]
end

# 0.7.0-DEV.3972
@test Compat.indexin([1, 2], [1, 0, 1]) == [1, nothing]

# 0.7.0-DEV.4585
@test isuppercase('A')
@test !isuppercase('a')
Expand Down

0 comments on commit 9d7f3f4

Please sign in to comment.