diff --git a/LanguageExt.Core/DataTypes/TrieMap/TrieMap.cs b/LanguageExt.Core/DataTypes/TrieMap/TrieMap.cs index 32444170f..0a7b83732 100644 --- a/LanguageExt.Core/DataTypes/TrieMap/TrieMap.cs +++ b/LanguageExt.Core/DataTypes/TrieMap/TrieMap.cs @@ -1111,6 +1111,13 @@ public void Deconstruct(out uint entryMap, out uint nodeMap, out (K, V)[] items, } else { + foreach (var item in Items) + { + if (default(EqK).Equals(item.Key, key)) + { + return (true, item.Key, item.Value); + } + } return default; } } @@ -1123,6 +1130,13 @@ public void Deconstruct(out uint entryMap, out uint nodeMap, out (K, V)[] items, } else { + foreach(var item in Items) + { + if(default(EqK).Equals(item.Key, key)) + { + return (true, item.Key, item.Value); + } + } return default; } } diff --git a/LanguageExt.Tests/HashMapTests.cs b/LanguageExt.Tests/HashMapTests.cs index 76556eabe..adfa4bc70 100644 --- a/LanguageExt.Tests/HashMapTests.cs +++ b/LanguageExt.Tests/HashMapTests.cs @@ -235,6 +235,11 @@ public void FetchBack() var rmv = Seq1(69); var map = toHashMap(init.Zip(Enumerable.Repeat(1, int.MaxValue))); + + Assert.True(map.ContainsKey(1477)); // false + Assert.True(map.Find(1477).IsSome); // false + + var minus = map.RemoveRange(rmv); Assert.True(minus.Keys.Find(i => i == 1477).IsSome); // true