You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parameterTypes array remains the same between calls, this could be moved out into a private static or private readonly field. The generator will have to falback to the current method if one of the parameters is a generic type scoped to the method.
The text was updated successfully, but these errors were encountered:
TimothyMakkison
changed the title
Generated code should use Array.Empty where possible
Generated code should use Array.Empty or constant field where possible
Nov 14, 2023
Array.Empty
Each method call with no parameters allocates an empty params and type array. To prevent unneeded allocations
Array.Empty
should be used instead.With Array.Empty
typeParameters
The
parameterTypes
array remains the same between calls, this could be moved out into aprivate static
orprivate readonly
field. The generator will have to falback to the current method if one of the parameters is a generic type scoped to the method.Before
After
Generic
typeParameters
The text was updated successfully, but these errors were encountered: