Skip to content

Commit

Permalink
Make the CharStr iterator unaware of the initial state of a Vector{Ch…
Browse files Browse the repository at this point in the history
…ar} iterator
  • Loading branch information
haampie committed Jun 2, 2018
1 parent f59a768 commit ae53af8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/strings/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,8 @@ mutable struct CharStr <: AbstractString
chars::Vector{Char}
CharStr(x) = new(collect(x))
end
Base.iterate(x::CharStr, i::Integer=1) = iterate(x.chars, i)
Base.iterate(x::CharStr) = iterate(x.chars)
Base.iterate(x::CharStr, state) = iterate(x.chars, state)
Base.lastindex(x::CharStr) = lastindex(x.chars)
@testset "cmp without UTF-8 indexing" begin
# Simple case, with just ANSI Latin 1 characters
Expand Down

0 comments on commit ae53af8

Please sign in to comment.