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

Vectorize System.Collections.Generic.Dictionary #110701

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public void ComparerImplementations_Dictionary_WithWellKnownStringComparers()
// Now exceed the collision threshold, which should rebucket entries.
// Continue adding a few more entries to ensure we didn't corrupt internal state.

for (int i = 100; i < 110; i++)
for (int i = 100; i < _collidingStrings.Count; i++)
{
string newKey = _collidingStrings[i];
Assert.Equal(0, _lazyGetNonRandomizedHashCodeDel.Value(newKey)); // ensure has a zero hash code Ordinal
Expand Down Expand Up @@ -364,7 +364,8 @@ public void ComparerImplementations_Dictionary_WithWellKnownStringComparers()
() => GetStringHashCodeOpenDelegate("GetNonRandomizedHashCodeOrdinalIgnoreCase"));

// n.b., must be initialized *after* delegate fields above
private static readonly List<string> _collidingStrings = GenerateCollidingStrings(110);
// FIXME: This can't generate more than 124 colliding strings
Copy link
Preview

Copilot AI Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment indicates a limitation in the GenerateCollidingStrings method. Ensure that the test cases account for this limitation or update the method to handle more cases if necessary.

This comment was generated based on a coding guideline created by a repository admin.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
private static readonly List<string> _collidingStrings = GenerateCollidingStrings(124);

private static List<string> GenerateCollidingStrings(int count)
{
Expand Down
Loading
Loading