Browse Source

Replace TryGetValue call with TryRemove call (#586)

Resolves #584
tags/1.0-rc
Finite Reality RogueException 8 years ago
parent
commit
ca18eb0eb4
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      src/Discord.Net.Commands/CommandService.cs

+ 1
- 2
src/Discord.Net.Commands/CommandService.cs View File

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


return RemoveModuleInternal(module); return RemoveModuleInternal(module);


Loading…
Cancel
Save