-
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
Fix missing hashcode set in OrderedDictionary.SetAt #103643
Conversation
...raries/System.Collections/tests/Generic/OrderedDictionary/OrderedDictionary.Generic.Tests.cs
Show resolved
Hide resolved
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.
Thanks!
CI appears to be in a bad state |
/ba-g ci is horked and this bug is blocking another p6 pr |
@@ -809,8 +809,8 @@ public void SetAt(int index, TKey key, TValue value) | |||
} | |||
|
|||
// The key doesn't match that index. If it exists elsewhere in the collection, fail. | |||
uint _ = 0, collisionCount = 0; | |||
if (IndexOf(key, ref _, ref collisionCount) >= 0) | |||
uint hashCode = 0, collisionCount = 0; |
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.
Just curious why do we use uint for collision count? In general we use signed everywhere unless we need the full range.
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.
This just copies what Dictionary<TKey, TValue>
does. I believe it uses uint just to make it very clear there's no possibility of overflow.
Fixes #103637