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

@@ -50,7 +50,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
foreach (var b in Rules.Info["player"].Traits.WithInterface<IBotInfo>().Select(t => t.Name))
{
var bot = b;
var botController = orderManager.LobbyInfo.Clients.Where(c => c.IsAdmin).FirstOrDefault();
var botController = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.IsAdmin);
bots.Add(new SlotDropDownOption(bot,
"slot_bot {0} {1} {2}".F(slot.PlayerReference, botController.Index, bot),
() => client != null && client.Bot == bot));