- Notifications
You must be signed in to change notification settings - Fork5.1k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ghost commentedMay 6, 2023
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. |
ghost commentedMay 6, 2023
Tagging subscribers to this area: @dotnet/area-system-collections Issue DetailsClose#66426
|
hrrrrustic commentedMay 7, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
AssertExtensions.Throws<ArgumentOutOfRangeException>(() => hashSet.TrimExcess(newCapacity)); | ||
} | ||
public void HashSet_TrimAccessCurrentCapacity_DoesNothing() |
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 OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Queue.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
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 wherenewCapacity == Count
.
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Queue.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
ghost commentedJul 6, 2023
This pull request has been automatically marked |
hrrrrustic commentedJul 15, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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. |
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/HashSet.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
eiriktsarpalis commentedAug 7, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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. |
ghost commentedNov 22, 2023
This pull request will now be closed since it had been marked |
ac578bf
to1246776
CompareI've rebased the changes and addressed remaining feedback. Should be good to merge now. |
Close#66426