mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-17 05:35:07 +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.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using ICD.Common.Properties;
|
using ICD.Common.Properties;
|
||||||
|
using ICD.Common.Utils.Extensions;
|
||||||
|
|
||||||
namespace ICD.Common.Utils.Collections
|
namespace ICD.Common.Utils.Collections
|
||||||
{
|
{
|
||||||
@@ -328,6 +329,18 @@ namespace ICD.Common.Utils.Collections
|
|||||||
return m_Dict.Remove(item);
|
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
|
#endregion
|
||||||
|
|
||||||
#region IEnumerable<T>
|
#region IEnumerable<T>
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
if (extends == null)
|
if (extends == null)
|
||||||
throw new ArgumentNullException("extends");
|
throw new ArgumentNullException("extends");
|
||||||
|
|
||||||
|
if (keys == null)
|
||||||
|
throw new ArgumentNullException("keys");
|
||||||
|
|
||||||
foreach (TKey key in keys)
|
foreach (TKey key in keys)
|
||||||
extends.Remove(key);
|
extends.Remove(key);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user