.Any(), .Count() -> .Count or .Length

This commit is contained in:
Eduardo Cáceres
2022-05-02 13:05:22 +02:00
committed by atlimit8
parent 6eb4fe8980
commit 79f321cb44
138 changed files with 233 additions and 258 deletions

View File

@@ -77,15 +77,15 @@ namespace OpenRA.Mods.Common.Traits.Render
// Per-actor production
queues = self.TraitsImplementing<ProductionQueue>()
.Where(q => productionInfos.Any(p => p.Produces.Contains(q.Info.Type)))
.Where(q => !Info.Queues.Any() || Info.Queues.Contains(q.Info.Type))
.Where(q => Info.Queues.Count == 0 || Info.Queues.Contains(q.Info.Type))
.ToArray();
if (!queues.Any())
if (queues.Length == 0)
{
// Player-wide production
queues = self.Owner.PlayerActor.TraitsImplementing<ProductionQueue>()
.Where(q => productionInfos.Any(p => p.Produces.Contains(q.Info.Type)))
.Where(q => !Info.Queues.Any() || Info.Queues.Contains(q.Info.Type))
.Where(q => Info.Queues.Count == 0 || Info.Queues.Contains(q.Info.Type))
.ToArray();
}
}