From 55bc903ea9face546c9d92fa3a0f40c9f66181b2 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Mon, 12 Feb 2024 22:53:54 +0000 Subject: [PATCH] perf: remove redundant Task.Run --- TcpDotNet/ProtocolClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TcpDotNet/ProtocolClient.cs b/TcpDotNet/ProtocolClient.cs index 550368e..b9d362c 100644 --- a/TcpDotNet/ProtocolClient.cs +++ b/TcpDotNet/ProtocolClient.cs @@ -82,7 +82,7 @@ public sealed class ProtocolClient : ClientNode BaseSocket = new Socket(remoteEP.AddressFamily, SocketType.Stream, ProtocolType.Tcp); try { - await Task.Run(() => BaseSocket.ConnectAsync(remoteEP, cancellationToken), cancellationToken); + await BaseSocket.ConnectAsync(remoteEP, cancellationToken); } catch {