diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-27 12:36:37 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-27 12:36:37 +0700 |
commit | 3176c087b90511375c9bbd90cc5a4b5ed7857c35 (patch) | |
tree | 8bbe7bb81547c2e9afc719f6fdbcf258698c226c /crypto/src/util/collections | |
parent | Generics migration work (diff) | |
download | BouncyCastle.NET-ed25519-3176c087b90511375c9bbd90cc5a4b5ed7857c35.tar.xz |
Generics migration in Pkcs
Diffstat (limited to 'crypto/src/util/collections')
-rw-r--r-- | crypto/src/util/collections/CollectionUtilities.cs | 9 |
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()) |