Skip to content

Commit

Permalink
improve inferrability of `findall(::Union{AbstractString,AbstractPatt…
Browse files Browse the repository at this point in the history
…ern}, ::AbstractString)`

eliminates possibilities of:
- `Base.convert(_::Type{UnitRange{Int64}}, item::Nothing)`
- `Base.iterate(itr::Nothing)`
- `Base.iterate(itr::Nothing)`
- `Base.lastindex(a::Nothing)`
  • Loading branch information
aviatesk committed Dec 4, 2020
1 parent 8dd959e commit 8b5f0a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/regex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ function findall(t::Union{AbstractString,AbstractPattern}, s::AbstractString; ov
i, e = firstindex(s), lastindex(s)
while true
r = findnext(t, s, i)
isnothing(r) && break
r === nothing && break
push!(found, r)
j = overlap || isempty(r) ? first(r) : last(r)
j > e && break
Expand Down

0 comments on commit 8b5f0a3

Please sign in to comment.