Skip to content

Commit ced0219

Browse files
committed
Deprecate rsearch and fix multiple things
1 parent 331d6a5 commit ced0219

File tree

14 files changed

+240
-203
lines changed

14 files changed

+240
-203
lines changed

base/deprecated.jl

+27-6
Original file line numberDiff line numberDiff line change
@@ -2120,21 +2120,42 @@ finalizer(f::Ptr{Void}, o::Function) = invoke(finalizer, Tuple{Ptr{Void}, Any},
21202120
@deprecate search(str::Union{String,SubString}, re::Regex) findfirst(re, str)
21212121
@deprecate search(s::AbstractString, r::Regex, idx::Integer) findnext(r, s, idx)
21222122
@deprecate search(s::AbstractString, r::Regex) findfirst(r, s)
2123-
@deprecate search(s::String, c::Char, i::Integer) findnext(equalto(c), s, i)
2124-
@deprecate search(s::String, c::Char) findfirst(equalto(c), s)
2123+
@deprecate search(s::AbstractString, c::Char, i::Integer) findnext(equalto(c), s, i)
2124+
@deprecate search(s::AbstractString, c::Char) findfirst(equalto(c), s)
21252125
# FIXME: no replacement to search for a multibyte char in a ByteArray
2126-
@deprecate search(a::Union{String,ByteArray}, b::Union{Int8,UInt8}, i::Integer = 1) findnext(equalto(b), a, i)
2127-
@deprecate search(a::String, b::Union{Int8,UInt8}, i::Integer = 1) findnext(equalto(Char(b)), a, i)
2128-
@deprecate search(a::ByteArray, b::Char, i::Integer = 1) findnext(equalto(Unt8(b)), a, i)
2126+
@deprecate search(a::ByteArray, b::Union{Int8,UInt8}, i::Integer) findnext(equalto(b), a, i)
2127+
@deprecate search(a::ByteArray, b::Union{Int8,UInt8}) findfirst(equalto(b), a)
2128+
@deprecate search(a::String, b::Union{Int8,UInt8}, i::Integer) findnext(equalto(b), Vector{UInt8}(a), i)
2129+
@deprecate search(a::String, b::Union{Int8,UInt8}) findfirst(equalto(b), Vector{UInt8}(a))
2130+
@deprecate search(a::ByteArray, b::Char, i::Integer) findnext(equalto(UInt8(b)), a, i)
2131+
@deprecate search(a::ByteArray, b::Char) findfirst(equalto(UInt8(b)), a)
21292132

21302133
@deprecate search(s::AbstractString, c::Union{Tuple{Vararg{Char}},AbstractVector{Char},Set{Char}}, i::Integer) findnext(x -> x in c, s, i)
2131-
@deprecate search(s::AbstractString, c::Union{Tuple{Vararg{Char}},AbstractVector{Char},Set{Char}}) findfirst(x -> x in c, s, i)
2134+
@deprecate search(s::AbstractString, c::Union{Tuple{Vararg{Char}},AbstractVector{Char},Set{Char}}) findfirst(x -> x in c, s)
21322135
@deprecate search(s::AbstractString, t::AbstractString, i::Integer) findnext(t, s, i)
21332136
@deprecate search(s::AbstractString, t::AbstractString) findfirst(t, s)
21342137

21352138
@deprecate search(buf::IOBuffer, delim::UInt8) findfirst(equalto(delim), buf)
21362139
@deprecate search(buf::Base.GenericIOBuffer, delim::UInt8) findfirst(equalto(delim), buf)
21372140

2141+
@deprecate rsearch(s::AbstractString, c::Union{Tuple{Vararg{Char}},AbstractVector{Char},Set{Char}}, i::Integer) findprev(x -> x in c, s, i)
2142+
@deprecate rsearch(s::AbstractString, c::Union{Tuple{Vararg{Char}},AbstractVector{Char},Set{Char}}) findlast(x -> x in c, s)
2143+
@deprecate rsearch(s::AbstractString, t::AbstractString, i::Integer) findprev(t, s, i)
2144+
@deprecate rsearch(s::AbstractString, t::AbstractString) findlast(t, s)
2145+
@deprecate rsearch(s::ByteArray, t::ByteArray, i::Integer) findprev(t, s, i)
2146+
@deprecate rsearch(s::ByteArray, t::ByteArray) findlast(t, s)
2147+
2148+
@deprecate rsearch(str::Union{String,SubString}, re::Regex, idx::Integer) findprev(re, str, idx)
2149+
@deprecate rsearch(str::Union{String,SubString}, re::Regex) findlast(re, str)
2150+
@deprecate rsearch(s::AbstractString, r::Regex, idx::Integer) findprev(r, s, idx)
2151+
@deprecate rsearch(s::AbstractString, r::Regex) findlast(r, s)
2152+
@deprecate rsearch(s::AbstractString, c::Char, i::Integer) findprev(equalto(c), s, i)
2153+
@deprecate rsearch(s::AbstractString, c::Char) findlast(equalto(c), s)
2154+
# FIXME: no replacement to search for a multibyte char in a ByteArray
2155+
@deprecate rsearch(a::Union{String,ByteArray}, b::Union{Int8,UInt8}, i::Integer = endof(a)) findprev(equalto(b), a, i)
2156+
@deprecate rsearch(a::String, b::Union{Int8,UInt8}, i::Integer = endof(a)) findprev(equalto(Char(b)), a, i)
2157+
@deprecate rsearch(a::ByteArray, b::Char, i::Integer = endof(a)) findprev(equalto(UInt8(b)), a, i)
2158+
21382159
# END 0.7 deprecations
21392160

21402161
# BEGIN 1.0 deprecations

base/exports.jl

-1
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,6 @@ export
771771
repr,
772772
reverseind,
773773
rpad,
774-
rsearch,
775774
rsearchindex,
776775
rsplit,
777776
rstrip,

base/libgit2/types.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ function Base.split(ce::ConfigEntry)
894894

895895
# Determine the positions of the delimiters
896896
subsection_delim = findfirst(equalto('.'), key)
897-
name_delim = rsearch(key, '.')
897+
name_delim = findlast(equalto('.'), key)
898898

899899
section = SubString(key, 1, subsection_delim - 1)
900900
subsection = SubString(key, subsection_delim + 1, name_delim - 1)

base/precompile.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,16 @@ precompile(Tuple{typeof(Base.REPL.ip_matches_func), Ptr{Void}, Symbol})
192192
precompile(Tuple{typeof(Base.throw_boundserror), Array{Ptr{Void}, 1}, Tuple{Base.UnitRange{Int64}}})
193193
precompile(Tuple{typeof(Base.unsafe_copy!), Array{Ptr{Void}, 1}, Int64, Array{Ptr{Void}, 1}, Int64, Int64})
194194
precompile(Tuple{Type{Base.Channel{Any}}, Int64})
195-
precompile(Tuple{typeof(Base.rsearch), String, UInt8, Int64})
196-
precompile(Tuple{typeof(Base.rsearch), String, Char, Int64})
197-
precompile(Tuple{typeof(Base.rsearch), Array{UInt8, 1}, UInt8, Int64})
195+
precompile(Tuple{typeof(Base._rsearch), String, UInt8, Int64})
196+
precompile(Tuple{typeof(Base._rsearch), String, Char, Int64})
197+
precompile(Tuple{typeof(Base._rsearch), Array{UInt8, 1}, UInt8, Int64})
198198
precompile(Tuple{typeof(Base._rsearchindex), Array{UInt8, 1}, Array{UInt8, 1}, Int64})
199199
precompile(Tuple{typeof(Base._rsearch), Array{UInt8, 1}, Array{UInt8, 1}, Int64})
200-
precompile(Tuple{typeof(Base.rsearch), Array{Int8, 1}, UInt8, Int64})
200+
precompile(Tuple{typeof(Base._rsearch), Array{Int8, 1}, UInt8, Int64})
201201
precompile(Tuple{typeof(Base._rsearchindex), Array{Int8, 1}, Array{UInt8, 1}, Int64})
202202
precompile(Tuple{typeof(Base._rsearch), Array{Int8, 1}, Array{UInt8, 1}, Int64})
203-
precompile(Tuple{typeof(Base.rsearch), Array{UInt8, 1}, Char, Int64})
204-
precompile(Tuple{typeof(Base.rsearch), Array{Int8, 1}, Char, Int64})
203+
precompile(Tuple{typeof(Base._rsearch), Array{UInt8, 1}, Char, Int64})
204+
precompile(Tuple{typeof(Base._rsearch), Array{Int8, 1}, Char, Int64})
205205
precompile(Tuple{typeof(Base.splice!), Array{Base.Multimedia.Display, 1}, Int64, Array{Any, 1}})
206206
precompile(Tuple{typeof(Core.Inference.isbits), Base.LineEdit.EmptyCompletionProvider})
207207
precompile(Tuple{typeof(Core.Inference.isbits), Base.LineEdit.EmptyHistoryProvider})
@@ -583,7 +583,7 @@ precompile(Tuple{typeof(Base.LineEdit.complete_line), Base.REPL.REPLCompletionPr
583583
precompile(Tuple{getfield(Base, Symbol("#kw##parse")), Array{Any, 1}, typeof(Base.parse), String})
584584
precompile(Tuple{typeof(Base.isvalid), Base.RevString{String}, Int64})
585585
precompile(Tuple{typeof(Base.nextind), Base.RevString{String}, Int64})
586-
precompile(Tuple{typeof(Base.rsearch), String, Array{Char, 1}, Int64})
586+
precompile(Tuple{typeof(Base._rsearch), String, Array{Char, 1}, Int64})
587587
precompile(Tuple{getfield(Base.REPLCompletions, Symbol("#kw##find_start_brace")), Array{Any, 1}, typeof(Base.REPLCompletions.find_start_brace), String})
588588
precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Void, Void, Void}})
589589
precompile(Tuple{typeof(Base.isidentifier), Base.SubString{String}})
@@ -665,7 +665,7 @@ precompile(Tuple{typeof(Base.rsearchindex), String, String, Int64})
665665
precompile(Tuple{typeof(Base._rsearch), String, String, Int64})
666666
precompile(Tuple{typeof(Base.unshift!), Array{Base.SubString{String}, 1}, Base.SubString{String}})
667667
precompile(Tuple{typeof(Base.startswith), String, Base.SubString{String}})
668-
precompile(Tuple{typeof(Base.rsearch), String, Array{Char, 1}})
668+
precompile(Tuple{typeof(Base._rsearch), String, Array{Char, 1}})
669669
precompile(Tuple{getfield(Base, Symbol("#kw##rsplit")), Array{Any, 1}, typeof(Base.rsplit), String, String})
670670
precompile(Tuple{typeof(Base.sort!), Array{String, 1}, Base.Sort.MergeSortAlg, Base.Order.ForwardOrdering})
671671
precompile(Tuple{typeof(Base.sort!), Array{String, 1}, Int64, Int64, Base.Sort.InsertionSortAlg, Base.Order.ForwardOrdering})

base/repl/LineEdit.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,11 @@ end
487487
# of the line.
488488

489489
function edit_move_up(buf::IOBuffer)
490-
npos = rsearch(buf.data, '\n', position(buf))
490+
npos = findprev(equalto(UInt8('\n')), buf.data, position(buf))
491491
npos == 0 && return false # we're in the first line
492492
# We're interested in character count, not byte count
493493
offset = length(content(buf, npos => position(buf)))
494-
npos2 = rsearch(buf.data, '\n', npos-1)
494+
npos2 = findprev(equalto(UInt8('\n')), buf.data, npos-1)
495495
seek(buf, npos2)
496496
for _ = 1:offset
497497
pos = position(buf)
@@ -509,7 +509,7 @@ function edit_move_up(s)
509509
end
510510

511511
function edit_move_down(buf::IOBuffer)
512-
npos = rsearch(buf.data[1:buf.size], '\n', position(buf))
512+
npos = findprev(equalto(UInt8('\n')), buf.data[1:buf.size], position(buf))
513513
# We're interested in character count, not byte count
514514
offset = length(String(buf.data[(npos+1):(position(buf))]))
515515
npos2 = findnext(equalto(UInt8('\n')), buf.data[1:buf.size], position(buf)+1)
@@ -1603,7 +1603,7 @@ function move_line_start(s::MIState)
16031603
if s.key_repeats > 0
16041604
move_input_start(s)
16051605
else
1606-
seek(buf, rsearch(buf.data, '\n', curpos))
1606+
seek(buf, findprev(equalto(UInt8('\n')), buf.data, curpos))
16071607
end
16081608
:move_line_start
16091609
end

base/repl/REPL.jl

+6-5
Original file line numberDiff line numberDiff line change
@@ -583,14 +583,15 @@ function history_search(hist::REPLHistoryProvider, query_buffer::IOBuffer, respo
583583

584584
!skip_current && searchdata == response_str[a:b] && return true
585585

586-
searchfunc, searchstart, skipfunc = backwards ? (rsearch, b, prevind) :
587-
(findfirst, a, nextind)
586+
searchfunc1, searchfunc2, searchstart, skipfunc = backwards ?
587+
(findlast, findprev, b, prevind) :
588+
(findfirst, findnext, a, nextind)
588589
skip_current && (searchstart = skipfunc(response_str, searchstart))
589590

590591
# Start searching
591592
# First the current response buffer
592593
if 1 <= searchstart <= endof(response_str)
593-
match = searchfunc(response_str, searchdata, searchstart)
594+
match = searchfunc2(searchdata, response_str, searchstart)
594595
if match != 0:-1
595596
seek(response_buffer, first(match) - 1)
596597
return true
@@ -601,7 +602,7 @@ function history_search(hist::REPLHistoryProvider, query_buffer::IOBuffer, respo
601602
idxs = backwards ? ((hist.cur_idx-1):-1:1) : ((hist.cur_idx+1):length(hist.history))
602603
for idx in idxs
603604
h = hist.history[idx]
604-
match = searchfunc === findfirst ? findfirst(searchdata, h) : rsearch(h, searchdata)
605+
match = searchfunc1(searchdata, h)
605606
if match != 0:-1 && h != response_str && haskey(hist.mode_mapping, hist.modes[idx])
606607
truncate(response_buffer, 0)
607608
write(response_buffer, h)
@@ -1019,7 +1020,7 @@ input_color(r::StreamREPL) = r.input_color
10191020
# heuristic function to decide if the presence of a semicolon
10201021
# at the end of the expression was intended for suppressing output
10211022
function ends_with_semicolon(line::AbstractString)
1022-
match = rsearch(line, ';')
1023+
match = findlast(equalto(';'), line)
10231024
if match != 0
10241025
# state for comment parser, assuming that the `;` isn't in a string or comment
10251026
# so input like ";#" will still thwart this to give the wrong (anti-conservative) answer

base/repl/REPLCompletions.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function complete_symbol(sym, ffunc)
4040

4141
lookup_module = true
4242
t = Union{}
43-
if rsearch(sym, non_identifier_chars) < rsearch(sym, '.')
43+
if findlast(x -> x in non_identifier_chars, sym) < findlast(equalto('.'), sym)
4444
# Find module
4545
lookup_name, name = rsplit(sym, ".", limit=2)
4646

@@ -257,7 +257,7 @@ function find_start_brace(s::AbstractString; c_start='(', c_end=')')
257257
end
258258
braces != 1 && return 0:-1, -1
259259
method_name_end = reverseind(r, i)
260-
startind = nextind(s, rsearch(s, non_identifier_chars, method_name_end))
260+
startind = nextind(s, findprev(x -> x in non_identifier_chars, s, method_name_end))
261261
return (startind:endof(s), method_name_end)
262262
end
263263

@@ -412,8 +412,8 @@ function afterusing(string::String, startpos::Int)
412412
end
413413

414414
function bslash_completions(string, pos)
415-
slashpos = rsearch(string, '\\', pos)
416-
if (rsearch(string, bslash_separators, pos) < slashpos &&
415+
slashpos = findprev(equalto('\\'), string, pos)
416+
if (findprev(x -> x in bslash_separators, string, pos) < slashpos &&
417417
!(1 < slashpos && (string[prevind(string, slashpos)]=='\\')))
418418
# latex / emoji symbol substitution
419419
s = string[slashpos:pos]
@@ -536,8 +536,8 @@ function completions(string, pos)
536536
return String[], 0:-1, false
537537
end
538538

539-
dotpos = rsearch(string, '.', pos)
540-
startpos = nextind(string, rsearch(string, non_identifier_chars, pos))
539+
dotpos = findprev(equalto('.'), string, pos)
540+
startpos = nextind(string, findprev(x -> x in non_identifier_chars, string, pos))
541541

542542
ffunc = (mod,x)->true
543543
suggestions = String[]

base/stream.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ end
11851185
show(io::IO, s::BufferStream) = print(io,"BufferStream() bytes waiting:",nb_available(s.buffer),", isopen:", s.is_open)
11861186

11871187
function wait_readbyte(s::BufferStream, c::UInt8)
1188-
while isopen(s) && findfirst(equalto(c), x.buffer) <= 0
1188+
while isopen(s) && findfirst(equalto(c), s.buffer) <= 0
11891189
wait(s.r_c)
11901190
end
11911191
end

base/strings/search.jl

+41-34
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ findfirst(pattern::AbstractString, string::AbstractString) =
2222
findnext(pattern, string, start(string))
2323

2424
# AbstractString implementation of the generic findnext interface
25-
function findnext(testf::Function, s::AbstractString, i::Integer=start(s))
25+
function findnext(testf::Function, s::AbstractString, i::Integer)
2626
@boundscheck (i < 1 || i > nextind(s,endof(s))) && throw(BoundsError(s, i))
2727
@inbounds while !done(s,i)
2828
d, j = next(s,i)
@@ -45,7 +45,7 @@ function _searchindex(s::Union{AbstractString,ByteArray},
4545
end
4646
t1, j2 = next(t,start(t))
4747
while true
48-
i = _searchindex(s,t1,i)
48+
i = findnext(equalto(t1),s,i)
4949
if i == 0 return 0 end
5050
c, ii = next(s,i)
5151
j = j2; k = ii
@@ -187,12 +187,12 @@ function _search(s, t, i::Integer)
187187
end
188188

189189
"""
190-
findnext(pattern::AbstractString, string::AbstractString, [start::Integer])
191-
findnext(pattern::Regex, string::String, [start::Integer])
190+
findnext(pattern::AbstractString, string::AbstractString, start::Integer)
191+
findnext(pattern::Regex, string::String, start::Integer)
192192
193-
Find the first occurrence of `pattern` in `string`. `pattern` can be either a
194-
string, or a regular expression, in which case `string` must be of type `String`.
195-
`start` optionally specifies a starting index.
193+
Find the next occurrence of `pattern` in `string` starting at position `start`.
194+
`pattern` can be either a string, or a regular expression, in which case `string`
195+
must be of type `String`.
196196
197197
The return value is a range of indexes where the matching sequence is found, such that
198198
`s[findnext(x, s, i)] == x`:
@@ -212,47 +212,50 @@ julia> findnext("Julia", "JuliaLang", 2)
212212
1:5
213213
```
214214
"""
215-
findnext(t::AbstractString, s::AbstractString, i::Integer=start(s)) = _search(s, t, i)
216-
findnext(t::ByteArray, s::ByteArray, i::Integer=start(s)) = _search(s, t, i)
217-
218-
function rsearch(s::AbstractString, c::Chars)
219-
f = c isa Char ? f = equalto(c) : x -> x in c
220-
j = findfirst(f, RevString(s))
221-
j == 0 && return 0
222-
endof(s)-j+1
223-
end
215+
findnext(t::AbstractString, s::AbstractString, i::Integer) = _search(s, t, i)
216+
# TODO: remove?
217+
findnext(t::ByteArray, s::ByteArray, i::Integer) = _search(s, t, i)
224218

225219
"""
226-
rsearch(s::AbstractString, chars::Chars, [start::Integer])
220+
findlast(pattern::AbstractString, string::AbstractString)
221+
findlast(pattern::Regex, string::String)
227222
228-
Similar to `search` but returning the last occurrence of the given characters within the
229-
given string, searching in reverse from `start`.
223+
Find the last occurrence of `pattern` in `string`. Equivalent to
224+
[`findlast(pattern, string, endof(s))`](@ref).
230225
231226
# Examples
232227
```jldoctest
233-
julia> rsearch("aaabbb","b")
234-
6:6
228+
julia> findlast("o", "Hello to the world")
229+
15:15
230+
231+
julia> findfirst("Julia", "JuliaLang")
232+
1:5
235233
```
236234
"""
237-
function rsearch(s::AbstractString, c::Chars, i::Integer)
238-
f = c isa Char ? f = equalto(c) : x -> x in c
235+
findlast(pattern::AbstractString, string::AbstractString) =
236+
findprev(pattern, string, endof(string))
237+
238+
# AbstractString implementation of the generic findprev interface
239+
function findprev(testf::Function, s::AbstractString, i::Integer)
239240
e = endof(s)
240-
j = findnext(f, RevString(s), e-i+1)
241+
j = findnext(testf, RevString(s), e-i+1)
241242
j == 0 && return 0
242243
e-j+1
243244
end
244245

245-
function _rsearchindex(s, t, i)
246+
function _rsearchindex(s::AbstractString,
247+
t::Union{AbstractString,Char,Int8,UInt8},
248+
i::Integer)
246249
if isempty(t)
247250
return 1 <= i <= nextind(s,endof(s)) ? i :
248251
throw(BoundsError(s, i))
249252
end
250-
t = RevString(t)
253+
t = t isa AbstractString ? RevString(t) : t
251254
rs = RevString(s)
252255
l = endof(s)
253256
t1, j2 = next(t,start(t))
254257
while true
255-
i = rsearch(s,t1,i)
258+
i = findprev(equalto(t1),s,i)
256259
if i == 0 return 0 end
257260
c, ii = next(rs,l-i+1)
258261
j = j2; k = ii
@@ -276,7 +279,10 @@ function _rsearchindex(s, t, i)
276279
end
277280
end
278281

279-
function _rsearchindex(s::Union{String,ByteArray}, t::Union{String,ByteArray}, k)
282+
_rsearchindex(s::String, t::String, i::Integer) =
283+
_rsearchindex(Vector{UInt8}(s), Vector{UInt8}(t), i)
284+
285+
function _rsearchindex(s::ByteArray, t::ByteArray, k::Integer)
280286
n = sizeof(t)
281287
m = sizeof(s)
282288

@@ -285,7 +291,7 @@ function _rsearchindex(s::Union{String,ByteArray}, t::Union{String,ByteArray}, k
285291
elseif m == 0
286292
return 0
287293
elseif n == 1
288-
return rsearch(s, _nthbyte(t,1), k)
294+
return findprev(equalto(_nthbyte(t,1)), s, k)
289295
end
290296

291297
w = m - n
@@ -342,7 +348,7 @@ rsearchindex(s::ByteArray, t::ByteArray, i::Integer) = _rsearchindex(s,t,i)
342348
"""
343349
rsearchindex(s::AbstractString, substring, [start::Integer])
344350
345-
Similar to [`rsearch`](@ref), but return only the start index at which the substring is found, or `0` if it is not.
351+
Similar to `rsearch`, but return only the start index at which the substring is found, or `0` if it is not.
346352
347353
# Examples
348354
```jldoctest
@@ -360,7 +366,7 @@ function rsearchindex(s::String, t::String)
360366
# Check for fast case of a single byte
361367
# (for multi-byte UTF-8 sequences, use rsearchindex instead)
362368
if endof(t) == 1
363-
rsearch(s, t[1])
369+
findprev(equalto(t[1]), s)
364370
else
365371
_rsearchindex(s, t, sizeof(s))
366372
end
@@ -370,7 +376,7 @@ function rsearchindex(s::String, t::String, i::Integer)
370376
# Check for fast case of a single byte
371377
# (for multi-byte UTF-8 sequences, use rsearchindex instead)
372378
if endof(t) == 1
373-
rsearch(s, t[1], i)
379+
findprev(equalto(t[1]), s, i)
374380
elseif endof(t) != 0
375381
_rsearchindex(s, t, nextind(s, i)-1)
376382
elseif i > sizeof(s)
@@ -391,8 +397,9 @@ function _rsearch(s, t, i::Integer)
391397
end
392398
end
393399

394-
rsearch(s::AbstractString, t::AbstractString, i::Integer=endof(s)) = _rsearch(s, t, i)
395-
rsearch(s::ByteArray, t::ByteArray, i::Integer=endof(s)) = _rsearch(s, t, i)
400+
findprev(t::AbstractString, s::AbstractString, i::Integer) = _rsearch(s, t, i)
401+
# TODO: remove?
402+
findprev(t::ByteArray, s::ByteArray, i::Integer) = _rsearch(s, t, i)
396403

397404
"""
398405
contains(haystack::AbstractString, needle::Union{AbstractString,Char})

0 commit comments

Comments
 (0)