Code inspection: Redundant spread element
This inspection identifies and highlights cases where the spread operator (e.g., ..
) in C# is used unnecessarily, such as expanding empty arrays or redundant constructs. Removing these operations improves code clarity and efficiency.
int[] unused = [.. new int[0]];
int[] unused = [];
Applying the quick-fix removes the redundant spread element and simplifies the code, ensuring better readability and adherence to best practices.
Last modified: 26 March 2025