diff --git a/ICD.Common.Utils/Collections/PriorityQueue.cs b/ICD.Common.Utils/Collections/PriorityQueue.cs index 7adc438..f269c2d 100644 --- a/ICD.Common.Utils/Collections/PriorityQueue.cs +++ b/ICD.Common.Utils/Collections/PriorityQueue.cs @@ -131,7 +131,24 @@ namespace ICD.Common.Utils.Collections if (remove == null) throw new ArgumentNullException("remove"); - EnqueueRemove(item, remove, int.MaxValue, false); + EnqueueRemove(item, remove, int.MaxValue); + } + + /// + /// Removes any items in the queue matching the predicate. + /// Appends the given item at the end of the given priority level. + /// This is useful for reducing duplication, or replacing items with something more pertinent. + /// + /// + /// + /// + [PublicAPI] + public void EnqueueRemove([CanBeNull] T item, [NotNull] Func remove, int priority) + { + if (remove == null) + throw new ArgumentNullException("remove"); + + EnqueueRemove(item, remove, priority, false); } ///