Tests/IMToolsTests.cs
/// <summary>Returns THE SAME partitioned map BUT with updated partion</summary>
Returns THE SAME partitioned map BUT with updated partion
Returns THE SAME partitioned map BUT with updated partion
[MethodImpl((MethodImplOptions)256)]
        public static void AddOrUpdate<K, V>(this ImHashMap234<K, V>[] parts, int hash, K key, V value, int partHashMask = PART_HASH_MASK)
        {
            ref var part = ref parts[hash & partHashMask];
            var p = part;
            if (Interlocked.CompareExchange(ref part, p.AddOrUpdate(hash, key, value), p) != p)
                RefAddOrUpdatePart(ref part, hash, key, value);
        }
[ MethodImpl ( ( MethodImplOptions ) 256 ) ] public static void AddOrUpdate < K , V > ( this ImHashMap234 < K , V > [ ] parts , int hash , K key , V value , int partHashMask = PART_HASH_MASK ) { ref var part = ref parts [ hash & partHashMask ] ; var p = part ; if ( Interlocked . CompareExchange ( ref part , p . AddOrUpdate ( hash , key , value ) , p ) != p ) RefAddOrUpdatePart ( ref part , hash , key , value ) ; }
Returns THE SAME partitioned map BUT with updated partion
Returns THE SAME partitioned map BUT with updated partion
ImHashMap234<K, V>[]
this
hash
int
key
K
value
V
partHashMask
int