-
Notifications
You must be signed in to change notification settings - Fork 983
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
Refactor ListView
to use Dictionary
instead of Hashtable
#8168
Conversation
@@ -80,7 +61,7 @@ public bool OwnerIsDesignMode | |||
|
|||
if (_owner.IsHandleCreated && !_owner.ListViewHandleDestroyed) | |||
{ | |||
return (ListViewItem)_owner._listItemsTable[DisplayIndexToID(displayIndex)]; | |||
return _owner._listItemsTable[DisplayIndexToID(displayIndex)]; |
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 will lead to a regression. Check #7089 and related PRs. We could use TryGetValue here, but I was never able to reproduce the problem with a test.
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.
@RussKie When you investigated this originally, was TryGetValue evaluated as a solution? Or was the issue more sinister than that?
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.
IIRC, whilst the signatures are the same, the behaviours and null value handling is different between Hashtable
and Dictionary<T,V>
types. TryGetValue
was found to be the solution.
Could you please confirm we have some test coverage for the changed code? |
It seems like the changes are indirectly covered by tests. But there is no direct testing of the code. |
Related: #8143
Microsoft Reviewers: Open in CodeFlow