Browse Source

Use C#7 pattern matching

pull/751/head
Christopher F 8 years ago
parent
commit
7f880806f2
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 1
- 2
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -1631,8 +1631,7 @@ namespace Discord.WebSocket


internal ISocketPrivateChannel AddPrivateChannel(API.Channel model, ClientState state) 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; return channel;
channel = SocketChannel.CreatePrivate(this, state, model); channel = SocketChannel.CreatePrivate(this, state, model);
state.AddChannel(channel as SocketChannel); state.AddChannel(channel as SocketChannel);


Loading…
Cancel
Save