feat: Adding RemoveRange method to IcdHashSet

This commit is contained in:
Chris Cameron
2019-05-10 11:47:00 -04:00
parent ecdb4f4fb5
commit 9d732ef4b2
2 changed files with 16 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using ICD.Common.Properties;
using ICD.Common.Utils.Extensions;
namespace ICD.Common.Utils.Collections
{
@@ -328,6 +329,18 @@ namespace ICD.Common.Utils.Collections
return m_Dict.Remove(item);
}
/// <summary>
/// Removes each of the items in the sequence from the collection.
/// </summary>
/// <param name="items"></param>
public void RemoveRange(IEnumerable<T> items)
{
if (items == null)
throw new ArgumentNullException("items");
m_Dict.RemoveAll(items);
}
#endregion
#region IEnumerable<T>

View File

@@ -19,6 +19,9 @@ namespace ICD.Common.Utils.Extensions
if (extends == null)
throw new ArgumentNullException("extends");
if (keys == null)
throw new ArgumentNullException("keys");
foreach (TKey key in keys)
extends.Remove(key);
}