-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Use collection expressions #2715
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
Replace `ToArray()` and `ToList()` calls with collection expressions, where relevant.
Make a few delegates static.
Add "Simmy" to the custom dictionary for the Visual Studio spellchecker.
Use primary constructor in `GeneratorHelper`.
Tidy up formatting of parameters.
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.
Pull Request Overview
This PR modernizes the codebase by replacing ToArray() and ToList() calls with collection expressions where applicable, updates some lambdas to be static, adds "Simmy" to the Visual Studio spellchecker dictionary, converts GeneratorHelper to use a primary constructor, and improves parameter formatting.
- Replaced LINQ method calls with collection expressions using the spread operator (
[..]) - Made lambdas
staticwhere they don't capture variables - Updated
GeneratorHelperto use primary constructor syntax - Improved code formatting for method parameters
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/Polly.Specs/Wrap/IPolicyWrapExtensionSpecs.cs | Replace ToList() with collection expression |
| test/Polly.Specs/Helpers/PolicyTResultExtensionsAsync.cs | Format parameters and replace formatting |
| test/Polly.Specs/Helpers/PolicyTResultExtensions.cs | Improve parameter formatting |
| test/Polly.Specs/Helpers/ContextualPolicyTResultExtensions.cs | Format method parameters |
| test/Polly.Extensions.Tests/Telemetry/TelemetryListenerImplTests.cs | Replace ToList() with collection expressions |
| test/Polly.Core.Tests/Retry/RetryHelperTests.cs | Replace ToArray() with collection expression |
| test/Polly.Core.Tests/ResiliencePipelineTests.cs | Replace ToArray() with collection expression |
| src/Snippets/Docs/Retry.cs | Replace ToImmutableArray() with collection expression |
| src/Polly/Wrap/ISyncPolicyPolicyWrapExtensions.cs | Replace ToArray() with collection expression |
| src/Polly/Wrap/IAsyncPolicyPolicyWrapExtensions.cs | Replace ToArray() with collection expressions |
| src/Polly.Testing/ResiliencePipelineExtensions.cs | Make lambda static |
| src/Polly.Extensions/Telemetry/TelemetryUtil.cs | Replace ToArray() with collection expression |
| src/Polly.Extensions/Telemetry/TelemetryOptions.cs | Replace ToList() with collection expressions |
| src/Polly.Extensions/Telemetry/TelemetryListenerImpl.cs | Replace ToList() with collection expressions |
| src/Polly.Core/Utils/Pipeline/CompositeComponent.cs | Replace ToList() with array expression and make lambda static |
| src/Polly.Core/Simmy/Utils/GeneratorHelper.cs | Convert to primary constructor |
| src/Polly.Core/CircuitBreaker/CircuitBreakerManualControl.cs | Replace ToArray() with collection expressions |
| exclusion.dic | Add "simmy" to spellchecker dictionary |
| bench/Polly.Core.Benchmarks/Utils/Helper.StrategyPipeline.cs | Replace ToArray() with collection expression and make lambda static |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2715 +/- ##
=======================================
Coverage 96.12% 96.12%
=======================================
Files 309 309
Lines 7118 7118
Branches 1006 1008 +2
=======================================
Hits 6842 6842
Misses 222 222
Partials 54 54
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
ToArray()andToList()calls with collection expressions, where relevant.static.GeneratorHelper.