Use Any() instead of Count() == 0

This commit is contained in:
ScottNZ
2014-06-14 02:04:51 +12:00
parent 831b9b3ca3
commit 5e641750aa

View File

@@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA.Server
var playerClients = server.LobbyInfo.Clients.Where(c => c.Bot == null && c.Slot != null); var playerClients = server.LobbyInfo.Clients.Where(c => c.Bot == null && c.Slot != null);
// Are all players ready? // Are all players ready?
if (playerClients.Count() == 0 || playerClients.Any(c => c.State != Session.ClientState.Ready)) if (!playerClients.Any() || playerClients.Any(c => c.State != Session.ClientState.Ready))
return; return;
// Are the map conditions satisfied? // Are the map conditions satisfied?