summary refs log tree commit diff
path: root/crypto/src/util/collections/CollectionUtilities.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-06-27 12:36:37 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-06-27 12:36:37 +0700
commit3176c087b90511375c9bbd90cc5a4b5ed7857c35 (patch)
tree8bbe7bb81547c2e9afc719f6fdbcf258698c226c /crypto/src/util/collections/CollectionUtilities.cs
parentGenerics migration work (diff)
downloadBouncyCastle.NET-ed25519-3176c087b90511375c9bbd90cc5a4b5ed7857c35.tar.xz
Generics migration in Pkcs
Diffstat (limited to '')
-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())