mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-12 03:05:06 +00:00
feat: Adding RemoveRange method to IcdHashSet
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user