Added MinBy, MaxBy, MinByOrDefault and MaxByOrDefault methods and replaced calls of the style OrderBy[Descending]().First[OrDefault]() which is not as performant.
This commit is contained in:
@@ -535,7 +535,7 @@ namespace OpenRA.Server
|
||||
LobbyInfo.Clients.RemoveAll(c => c.Bot != null && c.BotControllerClientIndex == toDrop.PlayerIndex);
|
||||
|
||||
var nextAdmin = LobbyInfo.Clients.Where(c1 => c1.Bot == null)
|
||||
.OrderBy(c => c.Index).FirstOrDefault();
|
||||
.MinByOrDefault(c => c.Index);
|
||||
|
||||
if (nextAdmin != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user