-
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 WeakRefCollection to use List<WeakRefObject?> instead of ArrayList #8189
Conversation
src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Internals/WeakRefCollection.cs
Outdated
Show resolved
Hide resolved
@@ -30,10 +30,10 @@ public WeakRefCollection() : this(4) | |||
|
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.
As a thought exercise - what if changed to this?
internal class WeakRefCollection : List<WeakRefObject?>
{
// ...
}
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.
I don't think we can do this easily and within the scope of this PR but you should raise a new issue where this can be debated. Changing the interface (or the class derived from) most likely would mean overriding several new methods.
src/System.Windows.Forms.Primitives/src/System/Windows/Forms/Internals/WeakRefCollection.cs
Outdated
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!
Related: #8140
Microsoft Reviewers: Open in CodeFlow