Avoid Count() when Any() could be used (CA1827)

This commit is contained in:
Matthias Mailänder
2022-09-06 18:08:25 +02:00
committed by Pavel Penev
parent 7ba6a49378
commit 67aa0cdede
2 changed files with 4 additions and 1 deletions

View File

@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
foreach (var section in sections.OrderBy(s => s.Key))
{
var fields = section.Value.GetType().GetFields();
if (fields.Length > 0 && fields.Where(field => field.GetCustomAttributes<DescAttribute>(false).Length > 0).Count() > 0)
if (fields.Any(field => field.GetCustomAttributes<DescAttribute>(false).Length > 0))
Console.WriteLine($"## {section.Key}");
else
Console.WriteLine();