C#

C#

Made by DeepSource

Explicit mention of array type and/or size is redundant when array is initialized CS-R1045

Anti-pattern
Major
Autofix

Consider dropping the array type and/or size when it is initialized explicitly using an initializer. This makes the syntax more concise.

Bad Practice

var arr = new int[5] {1, 2, 3, 4, 5};

Recommended

var arr = new[] {1, 2, 3, 4, 5};