Skip to content

Commit 2d06367

Browse files
committed
pr
1 parent a73403d commit 2d06367

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/MongoDB.Driver/Core/Connections/TcpStreamFactory.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ private async Task ConnectAsync(Socket socket, EndPoint endPoint, CancellationTo
208208
#if !NET472
209209
connectTask = socket.ConnectAsync(endPoint);
210210
#else
211-
var dnsEndPoint = endPoint as DnsEndPoint;
212-
if (dnsEndPoint != null)
211+
if (endPoint is DnsEndPoint dnsEndPoint)
213212
{
214213
// mono doesn't support DnsEndPoint in its BeginConnect method.
215214
connectTask = Task.Factory.FromAsync(socket.BeginConnect(dnsEndPoint.Host, dnsEndPoint.Port, null, null), socket.EndConnect);

0 commit comments

Comments
 (0)