Skip to content

Commit 8bc5c9a

Browse files
ranochaKristofferC
authored andcommitted
fix type instability/invalidations from nextind (#46489)
(cherry picked from commit 98e1b13)
1 parent bb94590 commit 8bc5c9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/strings/util.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ function iterate(iter::SplitIterator, (i, k, n)=(firstindex(iter.str), firstinde
533533
r = findnext(iter.splitter, iter.str, k)::Union{Nothing,Int,UnitRange{Int}}
534534
while r !== nothing && n != iter.limit - 1 && first(r) <= ncodeunits(iter.str)
535535
j, k = first(r), nextind(iter.str, last(r))::Int
536-
k_ = k <= j ? nextind(iter.str, j) : k
536+
k_ = k <= j ? nextind(iter.str, j)::Int : k
537537
if i < k
538538
substr = @inbounds SubString(iter.str, i, prevind(iter.str, j)::Int)
539539
(iter.keepempty || i < j) && return (substr, (k, k_, n + 1))

0 commit comments

Comments
 (0)