summary refs log tree commit diff
path: root/crypto/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/util')
-rw-r--r--crypto/src/util/collections/CollectionUtilities.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/src/util/collections/CollectionUtilities.cs b/crypto/src/util/collections/CollectionUtilities.cs
index 97bc374e1..f1d2bac21 100644
--- a/crypto/src/util/collections/CollectionUtilities.cs
+++ b/crypto/src/util/collections/CollectionUtilities.cs
@@ -71,6 +71,15 @@ namespace Org.BouncyCastle.Utilities.Collections
             return new UnmodifiableSetProxy(s);
         }
 
+        public static bool Remove<K, V>(IDictionary<K, V> d, K k, out V v)
+        {
+            if (!d.TryGetValue(k, out v))
+                return false;
+
+            d.Remove(k);
+            return true;
+        }
+
         public static object RequireNext(IEnumerator e)
         {
             if (!e.MoveNext())