Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Oct 7, 2024

Contributes to #67044

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 7, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Oct 7, 2024
@xtqqczze
Copy link
Contributor Author

xtqqczze commented Oct 7, 2024

@MihuBot

@xtqqczze
Copy link
Contributor Author

xtqqczze commented Oct 7, 2024

xtqqczze@494b163

@@ -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)
Copy link
Member

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)

@xtqqczze
Copy link
Contributor Author

xtqqczze commented Oct 7, 2024

@MihuBot

Copy link
Contributor

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community-contribution Indicates that the PR has been added by a community member needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants