From d2febe0fb97d28ac2e9db54e5f0d9c59388d7e52 Mon Sep 17 00:00:00 2001 From: Milan Bouchet-Valat Date: Fri, 13 Apr 2018 00:00:18 +0200 Subject: [PATCH] Stop using linearindices (#196) Prepare for deprecation of linearindices. This function was not strictly needed here. --- src/find/FindBenchmarks.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/find/FindBenchmarks.jl b/src/find/FindBenchmarks.jl index c931ad8e..54058f3f 100644 --- a/src/find/FindBenchmarks.jl +++ b/src/find/FindBenchmarks.jl @@ -55,7 +55,7 @@ const VEC_LENGTH = 1000 if VERSION < v"0.7.0-DEV.3399" function perf_findnext(x) - s = findnext(x, first(linearindices(x))) + s = findfirst(x) while s > 0 s = findnext(x, nextind(x, s)) end @@ -63,7 +63,7 @@ if VERSION < v"0.7.0-DEV.3399" end function perf_findprev(x) - s = findprev(x, last(linearindices(x))) + s = findlast(x) while s > 0 s = findprev(x, prevind(x, s)) end @@ -71,7 +71,7 @@ if VERSION < v"0.7.0-DEV.3399" end function perf_findnext(pred, x) - s = findnext(pred, x, first(linearindices(x))) + s = findfirst(pred, x) while s > 0 s = findnext(pred, x, nextind(x, s)) end @@ -79,7 +79,7 @@ if VERSION < v"0.7.0-DEV.3399" end function perf_findprev(pred, x) - s = findprev(pred, x, last(linearindices(x))) + s = findlast(pred, x) while s > 0 s = findprev(pred, x, prevind(x, s)) end @@ -89,7 +89,7 @@ if VERSION < v"0.7.0-DEV.3399" else function perf_findnext(x) - s = findnext(x, first(linearindices(x))) + s = findfirst(x) while s !== nothing s = findnext(x, nextind(x, s)) end @@ -97,7 +97,7 @@ else end function perf_findprev(x) - s = findprev(x, last(linearindices(x))) + s = findlast(x) while s !== nothing s = findprev(x, prevind(x, s)) end @@ -105,7 +105,7 @@ else end function perf_findnext(pred, x) - s = findnext(pred, x, first(linearindices(x))) + s = findfirst(pred, x) while s !== nothing s = findnext(pred, x, nextind(x, s)) end @@ -113,7 +113,7 @@ else end function perf_findprev(pred, x) - s = findprev(pred, x, last(linearindices(x))) + s = findlast(pred, x) while s !== nothing s = findprev(pred, x, prevind(x, s)) end