Skip to content

Commit 17a19a0

Browse files
committed
refactor: 精简代码提高可读性
1 parent a8c8dc7 commit 17a19a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BootstrapBlazor/Services/TcpSocket/DefaultTcpSocketClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public override async ValueTask<bool> SendAsync(ReadOnlyMemory<byte> data, Cance
119119

120120
public override async ValueTask<Memory<byte>> ReceiveAsync(CancellationToken token = default)
121121
{
122-
if (_client == null || !_client.Connected)
122+
if (_client is not { Connected: true })
123123
{
124124
throw new InvalidOperationException($"TCP Socket is not connected {LocalEndPoint}");
125125
}

0 commit comments

Comments
 (0)