-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove uint
casts in string.{Try}CopyTo
#108614
Conversation
@@ -432,14 +432,12 @@ public unsafe void CopyTo(int sourceIndex, char[] destination, int destinationIn | |||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |||
public void CopyTo(Span<char> destination) | |||
{ | |||
if ((uint)Length <= (uint)destination.Length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you revert to the previous order? because you see diffs from that and it doesn't allow to detect regressions from non-elided bound checks. The order shouldn't matter since PGO is going to reorder it its way anyway, also, the current order looks more efficient to me (rarely taken branches are moved down)
uint
casts in string.(Try)CopyTo
uint
casts in string.{Try}CopyTo
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Contributes to #67044