-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Description
.NET 8 introduce this 2 new analyzers to improve performance
https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1829
https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1859
Concerned code
CA1829:
| var pinnedItemsCount = instance.Items.Where(x => x.GroupName == JumpListPinnedGroupHeader).Count(); |
CA1859:
| private static IDictionary<CommandCodes, IRichCommand> CreateModifiableCommands() => new Dictionary<CommandCodes, IRichCommand> |
Gains
- Better readibility (no useless casting at CA1859 )
- Better performance
Requirements
- Refactor to the suggestions of the analyzer
Comments
I created #14951 but it was recused, it has compile errors and do more things, if authorized I can create a new PR
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done