summary refs log tree commit diff
path: root/crypto/src/util/collections/CollectionUtilities.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/util/collections/CollectionUtilities.cs')
-rw-r--r--crypto/src/util/collections/CollectionUtilities.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/src/util/collections/CollectionUtilities.cs b/crypto/src/util/collections/CollectionUtilities.cs
index 426700903..97bc374e1 100644
--- a/crypto/src/util/collections/CollectionUtilities.cs
+++ b/crypto/src/util/collections/CollectionUtilities.cs
@@ -45,9 +45,10 @@ namespace Org.BouncyCastle.Utilities.Collections
             return new StoreImpl<T>(contents);
         }
 
-        public static IEnumerable Proxy(IEnumerable e)
+        public static V GetValueOrNull<K, V>(IDictionary<K, V> d, K k)
+            where V : class
         {
-            return new EnumerableProxy(e);
+            return d.TryGetValue(k, out var v) ? v : null;
         }
 
         public static IEnumerable<T> Proxy<T>(IEnumerable<T> e)