Synopsis: | Consider using Any() to determine whether an IEnumerable is empty |
Language: | C# |
Severity Level: | 9 |
Category: | Performance |
Description: |
In many cases using Any() is more efficient than Count() . With Count() you risk that iterating over the entire collection has a significant impact. |
Literature References: |
MS Design numerable.Count |