Skip to content

Commit

Permalink
Remove deprecated findnext/findprev signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Jan 9, 2018
1 parent 8e7ae9f commit 64c3fbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions base/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,8 @@ end
findfirstnot(B::BitArray) = findnextnot(B,1)

# returns the index of the first matching element
function findnext(B::BitArray, v, start::Integer)
function findnext(pred::EqualTo, B::BitArray, start::Integer)
v = pred.x
v == false && return findnextnot(B, start)
v == true && return findnext(B, start)
return 0
Expand Down Expand Up @@ -1575,7 +1576,8 @@ end
findlastnot(B::BitArray) = findprevnot(B, length(B))

# returns the index of the previous matching element
function findprev(B::BitArray, v, start::Integer)
function findprev(pred::EqualTo, B::BitArray, start::Integer)
v = pred.x
v == false && return findprevnot(B, start)
v == true && return findprev(B, start)
return 0
Expand Down
2 changes: 1 addition & 1 deletion test/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ timesofar("nnz&find")
b1 = trues(v1)
b2 = falses(v1)
for i = 1:v1
@test findprev(b1, i) == findprev(b1, true, i) == findprev(identity, b1, i)
@test findprev(b1, i) == findprev(identity, b1, i)
@test findprevnot(b2, i) == findprev(!, b2, i) == i
end

Expand Down

0 comments on commit 64c3fbd

Please sign in to comment.