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

Fix .NET 3.5 InternableString.GetHashCode to match the full implementation #8340

Merged
merged 3 commits into from
Feb 6, 2023

Conversation

ladipro
Copy link
Member

@ladipro ladipro commented Jan 23, 2023

Fixes part of 8329

Context

The 3.5 version of InternableString uses a simpler hash code calculation, the results of which were not matching the 4.72/Core version. This manifested as a failing unit test RetainsLastStringWithGivenHashCode in VS.

Changes Made

Made the routine return the same numbers as the other implementation. It fixed the UT and also made the hash code "better" as previously we were shifting instead of rotating bits.

Testing

Existing unit tests (previously failing).

Notes

It would be nice to figure out how to run 3.5 tests in CI.

@ladipro ladipro mentioned this pull request Jan 23, 2023
10 tasks
@Forgind Forgind added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label Jan 30, 2023
@JaynieBai JaynieBai merged commit fc3ab4c into dotnet:main Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants