Tests/IMToolsTests.cs
/// <summary>Looks up for the key using its hash code and checking the key with `object.ReferenceEquals` for equality,
///  returns found value or the default value if not found</summary>
Looks up for the key using its hash code and checking the key with `object.ReferenceEquals` for equality,
returns found value or the default value if not found
Looks up for the key using its hash code and checking the key with ` object . ReferenceEquals ` for equality returns found value or the default value if not found
[MethodImpl((MethodImplOptions)256)]
        public static V GetValueOrDefaultReferenceEqual<K, V>(this ImHashMap234<K, V> map, int hash, K key) where K : class
        {
            var e = map.GetEntryOrDefault(hash);
            if (e is ImHashMap234<K, V>.ValueEntry v)
            {
                if (v.Key == key)
                    return v.Value;
            }
            else if (e is ImHashMap234<K, V>.ConflictsEntry c)
            {
                foreach (var x in c.Conflicts)
                    if (x.Key == key)
                        return x.Value;
            }
            return default;
        }
[ MethodImpl ( ( MethodImplOptions ) 256 ) ] public static V GetValueOrDefaultReferenceEqual < K , V > ( this ImHashMap234 < K , V > map , int hash , K key ) where K : class { var e = map . GetEntryOrDefault ( hash ) ; if ( e is ImHashMap234 < K , V > . ValueEntry v ) { if ( v . Key == key ) return v . Value ; } else if ( e is ImHashMap234 < K , V > . ConflictsEntry c ) { foreach ( var x in c . Conflicts ) if ( x . Key == key ) return x . Value ; } return default ; }
Looks up for the key using its hash code and checking the key with `object.ReferenceEquals` for equality,
returns found value or the default value if not found
Looks up for the key using its hash code and checking the key with ` object . ReferenceEquals ` for equality returns found value or the default value if not found
ImHashMap234<K, V>
this
hash
int
key
K