From 7fbd0ab08b1f10066971392e4235798f4e5fa248 Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Sat, 3 Feb 2018 00:48:19 -0800 Subject: [PATCH] simplification of GetMatch method for CommandParser --- src/Discord.Net.Commands/CommandParser.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Discord.Net.Commands/CommandParser.cs b/src/Discord.Net.Commands/CommandParser.cs index 64d975bf5..9b6c1cc03 100644 --- a/src/Discord.Net.Commands/CommandParser.cs +++ b/src/Discord.Net.Commands/CommandParser.cs @@ -40,13 +40,8 @@ namespace Discord.Commands char GetMatch(IReadOnlyDictionary dict, char ch) { // get the corresponding value for the key, if it exists - if (dict != null) - { - if (dict.TryGetValue(c, out var value)) - { - return value; - } - } + if (dict != null && dict.TryGetValue(c, out var value)) + return value; // or get the default pair of the default double quote return '\"'; }