6 instantiations of HashBucket
System.Collections.Immutable (6)
System\Collections\Immutable\ImmutableDictionary_2.HashBucket.cs (6)
146return new HashBucket(kv); 155return new HashBucket(kv, _additionalElements); 178return new HashBucket(_firstValue, _additionalElements.Add(kv)); 186return new HashBucket(_firstValue, _additionalElements.ReplaceAt(keyCollisionIndex, kv)); 236return new HashBucket(_additionalElements.Key, _additionalElements.RemoveAt(indexOfRootNode)); 249return new HashBucket(_firstValue, _additionalElements.RemoveAt(index));
70 references to HashBucket
System.Collections.Immutable (70)
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (5)
36private SortedInt32KeyNode<HashBucket> _root = SortedInt32KeyNode<HashBucket>.EmptyNode; 96var input = new MutationInput(SortedInt32KeyNode<HashBucket>.EmptyNode, comparers); 376private SortedInt32KeyNode<HashBucket> Root 620this.Root = SortedInt32KeyNode<HashBucket>.EmptyNode;
System\Collections\Immutable\ImmutableDictionary_2.Comparers.cs (6)
17/// To reduce allocations, we directly implement the <see cref="HashBucket"/> and Key-Only comparers, 21internal sealed class Comparers : IEqualityComparer<HashBucket>, IEqualityComparer<KeyValuePair<TKey, TValue>> 88internal IEqualityComparer<HashBucket> HashBucketEqualityComparer 101public bool Equals(HashBucket x, HashBucket y) 115public int GetHashCode(HashBucket obj)
System\Collections\Immutable\ImmutableDictionary_2.cs (28)
28private static readonly Action<KeyValuePair<int, HashBucket>> s_FreezeBucketAction = (kv) => kv.Value.Freeze(); 38private readonly SortedInt32KeyNode<HashBucket> _root; 51private ImmutableDictionary(SortedInt32KeyNode<HashBucket> root, Comparers comparers, int count) 68_root = SortedInt32KeyNode<HashBucket>.EmptyNode; 170foreach (KeyValuePair<int, ImmutableDictionary<TKey, TValue>.HashBucket> bucket in _root) 187foreach (KeyValuePair<int, ImmutableDictionary<TKey, TValue>.HashBucket> bucket in _root) 359SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> root = _root; 363HashBucket bucket; 367ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Remove(key, _comparers.KeyOnlyComparer, out result); 671internal SortedInt32KeyNode<HashBucket> Root 869HashBucket bucket; 884HashBucket bucket; 901HashBucket bucket; 917HashBucket bucket; 936HashBucket bucket = origin.Root.GetValueOrDefault(hashCode); 937ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Add(key, value, origin.KeyOnlyComparer, origin.ValueComparer, behavior, out result); 943SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = UpdateRoot(origin.Root, hashCode, newBucket, origin.HashBucketComparer); 955SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = origin.Root; 960HashBucket bucket = newRoot.GetValueOrDefault(hashCode); 962ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Add(pair.Key, pair.Value, origin.KeyOnlyComparer, origin.ValueComparer, collisionBehavior, out result); 979HashBucket bucket; 983SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = UpdateRoot(origin.Root, hashCode, bucket.Remove(key, origin.KeyOnlyComparer, out result), origin.HashBucketComparer); 993private static SortedInt32KeyNode<HashBucket> UpdateRoot(SortedInt32KeyNode<HashBucket> root, int hashCode, HashBucket newBucket, IEqualityComparer<HashBucket> hashBucketComparer) 1016private static ImmutableDictionary<TKey, TValue> Wrap(SortedInt32KeyNode<HashBucket> root, Comparers comparers, int count) 1030private ImmutableDictionary<TKey, TValue> Wrap(SortedInt32KeyNode<HashBucket>? root, int adjustedCountIfDifferentRoot)
System\Collections\Immutable\ImmutableDictionary_2.Enumerator.cs (8)
26private SortedInt32KeyNode<HashBucket>.Enumerator _mapEnumerator; 29/// The enumerator in use within an individual <see cref="HashBucket"/>. 31private HashBucket.Enumerator _bucketEnumerator; 43internal Enumerator(SortedInt32KeyNode<HashBucket> root, Builder? builder = null) 46_mapEnumerator = new SortedInt32KeyNode<HashBucket>.Enumerator(root); 47_bucketEnumerator = default(HashBucket.Enumerator); 89_bucketEnumerator = new HashBucket.Enumerator(_mapEnumerator.Current.Value); 107_bucketEnumerator = default(HashBucket.Enumerator);
System\Collections\Immutable\ImmutableDictionary_2.HashBucket.cs (16)
11/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.HashBucket"/> struct. 37/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.HashBucket"/> struct. 113/// Throws an exception to catch any errors in comparing <see cref="HashBucket"/> instances. 122/// Throws an exception to catch any errors in comparing <see cref="HashBucket"/> instances. 138/// <param name="result">A description of the effect was on adding an element to this <see cref="HashBucket"/>.</param> 139/// <returns>A new <see cref="HashBucket"/> that contains the added value and any values already held by this <see cref="HashBucket"/>.</returns> 140internal HashBucket Add(TKey key, TValue value, IEqualityComparer<KeyValuePair<TKey, TValue>> keyOnlyComparer, IEqualityComparer<TValue> valueComparer, KeyCollisionBehavior behavior, out OperationResult result) 212/// <param name="result">A description of the effect was on adding an element to this <see cref="HashBucket"/>.</param> 213/// <returns>A new <see cref="HashBucket"/> that does not contain the removed value and any values already held by this <see cref="HashBucket"/>.</returns> 214internal HashBucket Remove(TKey key, IEqualityComparer<KeyValuePair<TKey, TValue>> keyOnlyComparer, out OperationResult result) 341private readonly HashBucket _bucket; 349/// The enumerator that represents the current position over the <see cref="_additionalElements"/> of the <see cref="HashBucket"/>. 354/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.HashBucket.Enumerator"/> struct. 357internal Enumerator(HashBucket bucket)
System\Collections\Immutable\ImmutableDictionary_2.MutationInput.cs (4)
22private readonly SortedInt32KeyNode<HashBucket> _root; 36SortedInt32KeyNode<HashBucket> root, 56internal SortedInt32KeyNode<HashBucket> Root 96internal IEqualityComparer<HashBucket> HashBucketComparer
System\Collections\Immutable\ImmutableDictionary_2.MutationResult.cs (3)
19private readonly SortedInt32KeyNode<HashBucket> _root; 41internal MutationResult(SortedInt32KeyNode<HashBucket> root, int countAdjustment) 51internal SortedInt32KeyNode<HashBucket> Root