Add polyfill for List<T>.EnsureCapacity(...)#47
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a polyfill for the List<T>.EnsureCapacity(int) method that was introduced in .NET 6.0, making it available for older .NET versions including .NET Core (pre-6.0), .NET Framework, and .NET Standard.
- Implements
EnsureCapacityextension method with proper parameter validation - Adds comprehensive test coverage for the new functionality
- Updates signature documentation with method count
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| PolyShim/Signatures.md | Updates total counts and documents the new List<T>.EnsureCapacity(int) API with link to official documentation |
| PolyShim/Net60/List.cs | Implements the polyfill extension method with negative capacity validation and capacity adjustment logic |
| PolyShim.Tests/Net60/ListTests.cs | Adds three test cases covering capacity increase, no-op when already sufficient, and negative parameter validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #47 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.