Skip to content

Commit 7e5b225

Browse files
committed
Drop compat code for indexin from #515
1 parent 6c90585 commit 7e5b225

File tree

4 files changed

+3
-20
lines changed

4 files changed

+3
-20
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ Currently, the `@compat` macro supports the following syntaxes:
112112

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

115-
* `Compat.indexin` accepts any iterable as first argument, returns `nothing` (rather than `0`)
116-
for entries with no match and gives the index of the first (rather than the last) match
117-
([#25662], [#25998]).
118-
119115
* `isupper`, `islower`, `ucfirst` and `lcfirst` are now `isuppercase`, `islowercase`,
120116
`uppercasefirst` and `lowercasefirst` ([#26442]).
121117

src/Compat.jl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,6 @@ end
7676
end
7777
end
7878

79-
if VERSION < v"0.7.0-DEV.3972"
80-
function indexin(a, b::AbstractArray)
81-
inds = keys(b)
82-
bdict = Dict{eltype(b),eltype(inds)}()
83-
for (val, ind) in zip(b, inds)
84-
get!(bdict, val, ind)
85-
end
86-
return Union{eltype(inds), Nothing}[
87-
get(bdict, i, nothing) for i in a
88-
]
89-
end
90-
end
91-
9279
if VERSION < v"0.7.0-DEV.4585"
9380
export isuppercase, islowercase, uppercasefirst, lowercasefirst
9481
const isuppercase = isupper

test/old.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,3 +856,6 @@ mktempdir(@__DIR__) do dir
856856
end
857857
@test readdir(dir) == ["dest.jl"]
858858
end
859+
860+
# 0.7.0-DEV.3972
861+
@test Compat.indexin([1, 2], [1, 0, 1]) == [1, nothing]

test/runtests.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ if VERSION < v"0.7.0-DEV.4592"
8989
@test findall(occursin([1, 2]), [1]) == [1]
9090
end
9191

92-
# 0.7.0-DEV.3972
93-
@test Compat.indexin([1, 2], [1, 0, 1]) == [1, nothing]
94-
9592
# 0.7.0-DEV.4585
9693
@test isuppercase('A')
9794
@test !isuppercase('a')

0 commit comments

Comments
 (0)