public void Can_quickly_find_the_scattered_items_with_the_same_cache() { var map = new HashMapLeapfrog <int, string, IntEqualityComparer>(); map.AddOrUpdate(42, "1"); map.AddOrUpdate(43, "a"); map.AddOrUpdate(42 + 32, "2"); map.AddOrUpdate(45, "b"); map.AddOrUpdate(46, "c"); map.AddOrUpdate(42 + 32 + 32, "3"); string value; Assert.IsTrue(map.TryFind(42 + 32, out value)); Assert.AreEqual("2", value); Assert.IsTrue(map.TryFind(42 + 32 + 32, out value)); Assert.AreEqual("3", value); }
public void Can_add_key_with_0_hash_code() { var map = new HashMapLeapfrog <int, string, IntEqualityComparer>(); map.AddOrUpdate(0, "aaa"); map.AddOrUpdate(0 + 32, "2"); map.AddOrUpdate(0 + 32 + 32, "3"); string value; Assert.IsTrue(map.TryFind(0, out value)); Assert.AreEqual("aaa", value); }
public bool GetFromHashMap_LeapfrogWithDistanceBuffer_TryFind() => _mapLeapfrogWithDistanceBuffer.TryFind(_key, out var _);