You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
findnext(f, ::MyString, i) creates a temporary SubString{MyString} of the range to be searched, then calls pairs to iterate over indexes and characters [1]. pairs creates a keys iterator for the SubString [2][3]. When next method for EachStringIndex calls nextind it ends up at the AbstractString fallback method [4].
The default nextind increments the index by one and calls isvalid in a loop. I'm experimenting with an AbstractString that uses sparse 64-bit indexes. So nextind sometimes takes a very long time.
findnext(f, ::MyString, i)
creates a temporarySubString{MyString}
of the range to be searched, then callspairs
to iterate over indexes and characters [1].pairs
creates akeys
iterator for theSubString
[2][3]. Whennext
method forEachStringIndex
callsnextind
it ends up at theAbstractString
fallback method [4].The default
nextind
increments the index by one and callsisvalid
in a loop. I'm experimenting with anAbstractString
that uses sparse 64-bit indexes. Sonextind
sometimes takes a very long time.I have a work around for this:
... but it seems like it might be better for
Base
to include something like this:[1]
julia/base/strings/search.jl
Lines 105 to 115 in 5929c56
[2]
julia/base/abstractdict.jl
Line 138 in 5929c56
[3]
julia/base/strings/basic.jl
Lines 478 to 486 in 5929c56
[4]
julia/base/strings/basic.jl
Lines 462 to 471 in 5929c56
The text was updated successfully, but these errors were encountered: