Inspectopedia
 
2024.3

Unnecessary zero length array usage

Warning
New
Last modified: 03 December 2024

Reports allocations of arrays with known lengths of zero when there is a constant for that in the class of the array's element type. As zero-length arrays are immutable, you can save memory reusing the same array instance.

Example:

After the quick-fix is applied: