Replace some Where-FirstOrDefault chains with a single call to FirstOrDefault

This commit is contained in:
ScottNZ
2013-11-11 21:20:19 +13:00
parent 9643609c31
commit 7c5f3cc0f1
8 changed files with 9 additions and 10 deletions

View File

@@ -491,7 +491,7 @@ namespace OpenRA.Mods.RA.AI
// Use of this function requires that one squad of this type. Hence it is a piece of shit
Squad GetSquadOfType(SquadType type)
{
return squads.Where(s => s.type == type).FirstOrDefault();
return squads.FirstOrDefault(s => s.type == type);
}
Squad RegisterNewSquad(SquadType type, Actor target)