From 64c3fbd342c2f5ce0ad99f2e9b23e703bc7ea757 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Tue, 9 Jan 2018 12:18:37 -0600 Subject: [PATCH] Remove deprecated findnext/findprev signatures --- base/bitarray.jl | 6 ++++-- test/bitarray.jl | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/base/bitarray.jl b/base/bitarray.jl index f837977ea349c..5fecd2e0f06ca 100644 --- a/base/bitarray.jl +++ b/base/bitarray.jl @@ -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 @@ -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 diff --git a/test/bitarray.jl b/test/bitarray.jl index 38b6b38794a16..b3b9e539da90c 100644 --- a/test/bitarray.jl +++ b/test/bitarray.jl @@ -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