RCS1077 with temporary variable
Open
Area-Analyzers
Feature Request
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 294
- Avg merge
- 2h 30m
- Merged PRs (30d)
- 4
Description
**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**:
```csharp
int count = enumerable.Count();
if (count == 0)
{
return null;
}
```
**Code with Fix**:
```csharp
if (!enumerable.Any())
{
return null;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.