-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add Capacity property and overloaded TrimExcess #85877
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
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/area-system-collections Issue DetailsClose #66426
|
|
src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Collections/src/System/Collections/Generic/Stack.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.
Could you add a test checking that capacity expands after a buffer resize?
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Queue.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.
The TrimExcess implementation appears wrong to me for the case where newCapacity == Count
.
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Queue.cs
Outdated
Show resolved
Hide resolved
This pull request has been automatically marked |
Just a comment to remove inactivity label, don't want to open new PR later 😄 Btw what's the deadline for shipping in .net8? |
@jeffhandley can share the cutoff for work like this. |
A bit less than a month left, but do keep in mind that subsequent reviewing rounds can introduce additional delay. If it doesn't make it for .NET 8 that's OK too, we will be accepting .NET 9 contributions as soon as development for .NET 8 concludes. |
src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs
Outdated
Show resolved
Hide resolved
We're currently in the process of finalizing .NET 8 work, so we're not accepting any new features. I'll update the milestone and we can revisit this PR in a few weeks when .NET 9 feature work commences. |
This pull request will now be closed since it had been marked |
ac578bf
to
1246776
Compare
I've rebased the changes and addressed remaining feedback. Should be good to merge now. |
Close #66426