Fixing bug in dictionary extensions, additional tests

This commit is contained in:
Chris Cameron
2017-09-26 13:52:27 -04:00
parent 750d039794
commit 2a139e4f3d
2 changed files with 67 additions and 18 deletions

View File

@@ -21,15 +21,11 @@ namespace ICD.Common.Utils.Extensions
if (extends == null)
throw new ArgumentNullException("extends");
try
{
TKey key = extends.GetKey(value);
return extends.Remove(key);
}
catch (ArgumentOutOfRangeException)
{
TKey key;
if (!extends.TryGetKey(value, out key))
return false;
}
return extends.Remove(key);
}
/// <summary>