From 7f880806f29d02ea352f6b541a5d101dec1b3c7f Mon Sep 17 00:00:00 2001 From: Christopher F Date: Thu, 13 Jul 2017 09:16:06 -0400 Subject: [PATCH] Use C#7 pattern matching --- src/Discord.Net.WebSocket/DiscordSocketClient.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Discord.Net.WebSocket/DiscordSocketClient.cs b/src/Discord.Net.WebSocket/DiscordSocketClient.cs index 828292a71..1511a7e88 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketClient.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketClient.cs @@ -1631,8 +1631,7 @@ namespace Discord.WebSocket internal ISocketPrivateChannel AddPrivateChannel(API.Channel model, ClientState state) { - ISocketPrivateChannel channel; - if ((channel = state.GetChannel(model.Id) as ISocketPrivateChannel) != null) + if (state.GetChannel(model.Id) is ISocketPrivateChannel channel) return channel; channel = SocketChannel.CreatePrivate(this, state, model); state.AddChannel(channel as SocketChannel);