JetBrains Rider 2025.1 Help

Code inspection: Redundant collection copy

This inspection highlights unnecessary calls that copy collection data when it's not required, such as using .ToList() or .ToArray() on collections that are already compatible or being enumerated without modification.

void Test() { var arr = new int[5].ToArray(); }
void Test() { var arr = new int[5]; }

Avoid redundant calls to collection copy methods when they don't serve a specific purpose, as they can add unnecessary overhead to the program.

Last modified: 08 April 2025