roslynator
roslynator copied to clipboard
Feature Request: Remove unnecessary array declaration in params parameter
trafficstars
May I request a feature that removes unnecessary array declarations in a params parameter?
For example in the following context
static class Program
{
static void M()
{
Sum(new int[] { 1, 2, 3 });
Sum(1, 2, 3);
}
static int Sum(params int[] values) => values.Sum();
}
Offer to change this
Sum(new int[] { 1, 2, 3 });
To this
Sum(1, 2, 3);