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
{{ message }}
Repository navigation
Resolve differences between string.IndexOfAny and MemoryExtensions.IndexOfAny #60864
For a number of values <= 5, string.IndexOfAny just delegates to MemoryExtensions.IndexOfAny. But for values length > 5, it implements a "probabilistic map" (basically a Bloom filter) that it uses when walking each element of the input to determine whether it's likely in the set, and then does the actual comparison against the set only for the likely ones. In contrast, for values length > 5, MemoryExtensions.IndexOfAny walks each character in the input, and for each walks each of the values to see if they match.
There's little reason these should be different. We should decide on and pick the better strategy (or an even better one if such a thing exists), use it in MemoryExtensions.IndexOfAny, and then have the string.IndexOfAny just unconditionally delegate to MemoryExtensions.
Activity