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
In the implementation of MemoryExtensions.IndexOfAny<T>(ROS<T>, ROS<T>) [see code], small needle spans are special-cased for T=byte and T=char and sent to specialized helpers in SpanHelpers. But for any other T, these small needle spans are not special-cased, and control flow goes to the generalized SpanHelpers.IndexOfAny<T>(ref T, int, ref T, int) routine, even though n-ary specialized helpers exist.
We should consider special-casing these lengths within the MemoryExtensions.IndexOfAny and LastIndexOfAny methods and funneling to the specialized n-ary helpers. Or, if there's a specific reason this logic was left out for non-byte / non-char types T, we should put a comment in the code to clarify why this logic has been excluded.
The text was updated successfully, but these errors were encountered:
In the implementation of MemoryExtensions.IndexOfAny<T>(ROS<T>, ROS<T>) [see code], small needle spans are special-cased for T=byte and T=char and sent to specialized helpers in SpanHelpers. But for any other T, these small needle spans are not special-cased, and control flow goes to the generalized SpanHelpers.IndexOfAny<T>(ref T, int, ref T, int) routine, even though n-ary specialized helpers exist.
We should consider special-casing these lengths within the MemoryExtensions.IndexOfAny and LastIndexOfAny methods and funneling to the specialized n-ary helpers. Or, if there's a specific reason this logic was left out for non-byte / non-char types T, we should put a comment in the code to clarify why this logic has been excluded.
Based on a conversation at #53652 (comment).
In the implementation of
MemoryExtensions.IndexOfAny<T>(ROS<T>, ROS<T>)
[see code], small needle spans are special-cased for T=byte and T=char and sent to specialized helpers inSpanHelpers
. But for any other T, these small needle spans are not special-cased, and control flow goes to the generalizedSpanHelpers.IndexOfAny<T>(ref T, int, ref T, int)
routine, even though n-ary specialized helpers exist.We should consider special-casing these lengths within the
MemoryExtensions.IndexOfAny
andLastIndexOfAny
methods and funneling to the specialized n-ary helpers. Or, if there's a specific reason this logic was left out for non-byte / non-char types T, we should put a comment in the code to clarify why this logic has been excluded.The text was updated successfully, but these errors were encountered: