ReSharper
 
Get ReSharper
You are viewing the documentation for an earlier version of ReSharper.

Code Inspection: Redundant explicit array size specification in array creation

Last modified: 21 July 2022

If you initialize an array by enumerating the values of its elements, there is no need to specify its size because the size is supplied by the number of elements in the array initializer.

ReSharper suggests a quick-fix that removes the explicit specification of the array size.