roslynator icon indicating copy to clipboard operation
roslynator copied to clipboard

RCS1077 with temporary variable

Open xtqqczze opened this issue 5 years ago • 0 comments
trafficstars

Product and Version Used: v2.9.0

RCS1077: Optimize LINQ method call is not applied in some cases, i.e. when a variable could be inlined.

Code with Diagnostic:

int count = enumerable.Count();
if (count == 0)
{
    return null;
}

Code with Fix:

if (!enumerable.Any())
{
    return null;
}

xtqqczze avatar Jun 15 '20 14:06 xtqqczze