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 f57f7e6 commit 5887884
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 @@ -109,10 +109,6 @@ Currently, the `@compat` macro supports the following syntaxes:

## Renaming

* `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 @@ -864,3 +864,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 @@ -82,9 +82,6 @@ end

@test codeunit("foo") == codeunit(SubString("fooαβγ",1,3)) == UInt8

# 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 5887884

Please sign in to comment.