-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
strings"Strings!""Strings!"
Description
We have (as described in #49547):
julia> findprev(==('x'), "x", 1)
1
julia> findprev(==('x'), "x", 2)
I don't think this makes much sense. It's also inconsistent with:
julia> findprev("x", "x", 1)
1:1
julia> findprev("x", "x", 2)
julia> findprev("ab", "ab", 2)
1:2
julia> findprev("ab", "ab", 3)
1:2
@KristofferC did some digging and found that I may have introduced this original behavior in 5e57c0b#diff-66843bd6e4b813dc28435a71b7a73a22f5fba6da4912e32eaf6d5f58745f8079R1269 and it has propagated from there since without a second thought. I think this might have been a bug. The condition makes sense for forward search, but I don't think it makes a lot of sense for reverse search. Nevertheless, it's been the behavior for many years, so we should probably decide carefully if and how to replace it.
Metadata
Metadata
Assignees
Labels
strings"Strings!""Strings!"