Replace TryGetValue call with TryRemove call (#586)

Resolves #584
This commit is contained in:
Finite Reality
2017-03-23 14:03:06 +00:00
committed by RogueException
parent 35d7a0cec8
commit ca18eb0eb4

View File

@@ -159,8 +159,7 @@ namespace Discord.Commands
try try
{ {
ModuleInfo module; ModuleInfo module;
_typedModuleDefs.TryGetValue(typeof(T), out module); if (!_typedModuleDefs.TryRemove(typeof(T), out module))
if (module == default(ModuleInfo))
return false; return false;
return RemoveModuleInternal(module); return RemoveModuleInternal(module);