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

@@ -138,8 +138,7 @@ namespace OpenRA.Mods.RA.Widgets
var actor = world.Selection.Actors
.Where(a => a.Owner == world.LocalPlayer && !a.Destroyed)
.Select(a => Pair.New(a, a.TraitOrDefault<AutoTarget>()))
.Where(a => a.Second != null)
.FirstOrDefault();
.FirstOrDefault(a => a.Second != null);
if (actor.First == null)
return true;