Skip to content

Commit

Permalink
avoid export conflict for Reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Oct 23, 2017
1 parent 43adac2 commit 353d565
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions base/strings/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -662,10 +662,9 @@ function last(str::AbstractString, nchar::Integer)
end

# reverse-order iteration for strings and indices thereof
using Base.Iterators: Reverse
start(r::Reverse{<:AbstractString}) = endof(r.itr)
done(r::Reverse{<:AbstractString}, i) = i < start(r.itr)
next(r::Reverse{<:AbstractString}, i) = (r.itr[i], prevind(r.itr, i))
start(r::Reverse{<:EachStringIndex}) = endof(r.itr.s)
done(r::Reverse{<:EachStringIndex}, i) = i < start(r.itr.s)
next(r::Reverse{<:EachStringIndex}, i) = (i, prevind(r.itr.s, i))
start(r::Iterators.Reverse{<:AbstractString}) = endof(r.itr)
done(r::Iterators.Reverse{<:AbstractString}, i) = i < start(r.itr)
next(r::Iterators.Reverse{<:AbstractString}, i) = (r.itr[i], prevind(r.itr, i))
start(r::Iterators.Reverse{<:EachStringIndex}) = endof(r.itr.s)
done(r::Iterators.Reverse{<:EachStringIndex}, i) = i < start(r.itr.s)
next(r::Iterators.Reverse{<:EachStringIndex}, i) = (i, prevind(r.itr.s, i))

0 comments on commit 353d565

Please sign in to comment.