Skip to content

Commit

Permalink
fix type instability/invalidations from nextind (#46489)
Browse files Browse the repository at this point in the history
(cherry picked from commit 98e1b13)
  • Loading branch information
ranocha authored and KristofferC committed Aug 30, 2022
1 parent bb94590 commit 8bc5c9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/strings/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ function iterate(iter::SplitIterator, (i, k, n)=(firstindex(iter.str), firstinde
r = findnext(iter.splitter, iter.str, k)::Union{Nothing,Int,UnitRange{Int}}
while r !== nothing && n != iter.limit - 1 && first(r) <= ncodeunits(iter.str)
j, k = first(r), nextind(iter.str, last(r))::Int
k_ = k <= j ? nextind(iter.str, j) : k
k_ = k <= j ? nextind(iter.str, j)::Int : k
if i < k
substr = @inbounds SubString(iter.str, i, prevind(iter.str, j)::Int)
(iter.keepempty || i < j) && return (substr, (k, k_, n + 1))
Expand Down

0 comments on commit 8bc5c9a

Please sign in to comment.