Use static lambdas wherever possible

Thanks Rider
This commit is contained in:
Archi
2021-09-27 21:33:52 +02:00
parent f2d3a2a894
commit 7e9e90764b
39 changed files with 236 additions and 234 deletions

View File

@@ -412,7 +412,7 @@ namespace ArchiSteamFarm {
// Stop all the active bots so they can disconnect cleanly
if (Bot.Bots?.Count > 0) {
// Stop() function can block due to SK2 sockets, don't forget a maximum delay
await Task.WhenAny(Utilities.InParallel(Bot.Bots.Values.Select(bot => Task.Run(() => bot.Stop(true)))), Task.Delay(Bot.Bots.Count * WebBrowser.MaxTries * 1000)).ConfigureAwait(false);
await Task.WhenAny(Utilities.InParallel(Bot.Bots.Values.Select(static bot => Task.Run(() => bot.Stop(true)))), Task.Delay(Bot.Bots.Count * WebBrowser.MaxTries * 1000)).ConfigureAwait(false);
// Extra second for Steam requests to go through
await Task.Delay(1000).ConfigureAwait(false);