Skip to content

Commit

Permalink
fixup! strings: add eachsplit for iterative splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
anaveragehuman committed Apr 19, 2021
1 parent 94e3e09 commit 4b2d6c9
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 @@ -416,7 +416,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) <= lastindex(iter.str)
j, k = first(r), nextind(iter.str, last(r))::Int
k_ = ifelse(k <= j, nextind(iter.str, j), k)
k_ = k <= j ? nextind(iter.str, j) : k
if i < k
substr = @inbounds SubString(iter.str, i, prevind(iter.str, j)::Int)
return (substr, (max(i, k), k_, n + Int(i < j)))
Expand Down

0 comments on commit 4b2d6c9

Please sign in to comment.