From c374b8565b783c58d2376d7bd5d1c04b6afe969a Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Thu, 6 Mar 2025 14:08:29 +0800 Subject: [PATCH] Update SpeedtestService.cs AI-optimized code --- v2rayN/ServiceLib/Services/SpeedtestService.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/v2rayN/ServiceLib/Services/SpeedtestService.cs b/v2rayN/ServiceLib/Services/SpeedtestService.cs index 05de5b02..e9ab1344 100644 --- a/v2rayN/ServiceLib/Services/SpeedtestService.cs +++ b/v2rayN/ServiceLib/Services/SpeedtestService.cs @@ -141,8 +141,7 @@ namespace ServiceLib.Services } })); } - Task.WaitAll([.. tasks]); - await Task.CompletedTask; + await Task.WhenAll(tasks); } private async Task RunRealPingBatchAsync(List lstSelected, string exitLoopKey, int pageSize = 0) @@ -216,7 +215,7 @@ namespace ServiceLib.Services await DoRealPing(downloadHandle, it); })); } - Task.WaitAll(tasks.ToArray()); + await Task.WhenAll(tasks); } catch (Exception ex) { @@ -291,7 +290,7 @@ namespace ServiceLib.Services } })); } - Task.WaitAll(tasks.ToArray()); + await Task.WhenAll(tasks); } private async Task DoRealPing(DownloadService downloadHandle, ServerTestItem it)