Skip to content

Commit e4dd4f9

Browse files
committed
Make the CharStr iterator unaware of the initial state of a Vector{Char} iterator
1 parent acff4d8 commit e4dd4f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/strings/basic.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,8 @@ mutable struct CharStr <: AbstractString
555555
chars::Vector{Char}
556556
CharStr(x) = new(collect(x))
557557
end
558-
Base.iterate(x::CharStr, i::Integer=1) = iterate(x.chars, i)
558+
Base.iterate(x::CharStr) = iterate(x.chars)
559+
Base.iterate(x::CharStr, state) = iterate(x.chars, state)
559560
Base.lastindex(x::CharStr) = lastindex(x.chars)
560561
@testset "cmp without UTF-8 indexing" begin
561562
# Simple case, with just ANSI Latin 1 characters

0 commit comments

Comments
 (0)