C#

C#

Made by DeepSource

Consider using Any() to check for emptiness CS-R1032

Anti-pattern
Major
Autofix

The Any() method lets you check for emptiness of an array or a collection. Consider using it over Count().

Bad Practice

var isNotEmpty = arr.Count() != 0;

Recommended

var isNotEmpty = arr.Any();