-
Notifications
You must be signed in to change notification settings - Fork 199
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
Flesh out PooledArrayBuilder<T>
a bit
#10606
Merged
DustinCampbell
merged 16 commits into
dotnet:main
from
DustinCampbell:pooledarraybuilder-tweaks
Jul 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6b6696a
Use collection expressions
DustinCampbell 86e57e5
Mark method as readonly
DustinCampbell 171f21c
Add First(), FirstOrDefault(), Last() and LastOrDefault() methods
DustinCampbell 5e62258
Add Single() and SingleOrDefault() methods
DustinCampbell 7a3e1e5
Prefer TheoryData in tests
DustinCampbell 6647eb0
Add tests for new PooledArrayBuilder methods
DustinCampbell 0abee9c
Fix XML doc comment typo
DustinCampbell 9f10648
Add predicate overloads, XML doc comments, and more tests
DustinCampbell 9b1be71
Reorder parameters for IReadOnlyList extensions and move to shared
DustinCampbell 9e49c20
Prefer collection expressions and remove argument null checks
DustinCampbell a17a33a
Add other Any(...) and All(...) overloads for `IReadOnlyList<T>`
DustinCampbell 50b66b8
Add First/Last/Single extension methods for IReadOnlyList
DustinCampbell 1cfff80
Add unit tests for ReadOnlyListExtensions
DustinCampbell 5deabb0
Add TArg-variant overloads to LINQ-style methods in PooledArrayBuilde…
DustinCampbell 0dc2455
Add defaultValue-variants for PooledArrayBuilder LINQ-style APIs
DustinCampbell 66427f4
convert enumerables and enumerators to ref structs
DustinCampbell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What's the benefit of changing these to
ref struct
types?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.
It came out of @jjonescz's comment on a different PR here. Essentially, there's no reason to ever want to box these types. So, it's just a little extra protection. I don't think there's really much value in this change, but it was simple enough. It's just a little extra protection. After all, if the user wants to pass an
IReadOnlyList<T>
to anIEnumerable<T>
, they can just pass it.