Browse Source

Delegate for comparisons

release/3.x.x
Paul Fake 6 years ago
committed by GitHub
parent
commit
74d59673a8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      Source/MQTTnet/Internal/BlockingQueue.cs

+ 2
- 2
Source/MQTTnet/Internal/BlockingQueue.cs View File

@@ -77,11 +77,11 @@ namespace MQTTnet.Internal
}
}

public void RemoveFirstIfEqual(TItem item)
public void RemoveFirstIfEqual(TItem item, Func<TItem, TItem, bool> areEqual)
{
lock (_syncRoot)
{
if (_items.Count > 0 && EqualityComparer<TItem>.Default.Equals(_items.First.Value, item))
if (_items.Count > 0 && areEqual(_items.First.Value, item))
{
_items.RemoveFirst();
}


Loading…
Cancel
Save