4 instantiations of SortedInt32KeyNode
System.Collections.Immutable (4)
System\Collections\Immutable\SortedInt32KeyNode.cs (4)
27internal static readonly SortedInt32KeyNode<TValue> EmptyNode = new SortedInt32KeyNode<TValue>(); 412return new SortedInt32KeyNode<TValue>(key, value, this, this); 444result = new SortedInt32KeyNode<TValue>(key, value, _left!, _right!); 541return new SortedInt32KeyNode<TValue>(_key, _value!, left ?? _left, right ?? _right);
118 references to SortedInt32KeyNode
System.Collections.Immutable (118)
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.cs (12)
38private readonly SortedInt32KeyNode<HashBucket> _root; 51private ImmutableDictionary(SortedInt32KeyNode<HashBucket> root, Comparers comparers, int count) 68_root = SortedInt32KeyNode<HashBucket>.EmptyNode; 359SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> root = _root; 671internal SortedInt32KeyNode<HashBucket> Root 943SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = UpdateRoot(origin.Root, hashCode, newBucket, origin.HashBucketComparer); 955SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = origin.Root; 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 (3)
26private SortedInt32KeyNode<HashBucket>.Enumerator _mapEnumerator; 43internal Enumerator(SortedInt32KeyNode<HashBucket> root, Builder? builder = null) 46_mapEnumerator = new SortedInt32KeyNode<HashBucket>.Enumerator(root);
System\Collections\Immutable\ImmutableDictionary_2.MutationInput.cs (3)
22private readonly SortedInt32KeyNode<HashBucket> _root; 36SortedInt32KeyNode<HashBucket> root, 56internal SortedInt32KeyNode<HashBucket> Root
System\Collections\Immutable\ImmutableDictionary_2.MutationResult.cs (3)
19private readonly SortedInt32KeyNode<HashBucket> _root; 41internal MutationResult(SortedInt32KeyNode<HashBucket> root, int countAdjustment) 51internal SortedInt32KeyNode<HashBucket> Root
System\Collections\Immutable\ImmutableHashSet_1.Builder.cs (5)
35private SortedInt32KeyNode<HashBucket> _root = SortedInt32KeyNode<HashBucket>.EmptyNode; 118ImmutableHashSet<T>.MutationResult result = Union(this, new MutationInput(SortedInt32KeyNode<HashBucket>.EmptyNode, value, _hashBucketEqualityComparer, 0)); 147private SortedInt32KeyNode<HashBucket> Root 268this.Root = SortedInt32KeyNode<HashBucket>.EmptyNode;
System\Collections\Immutable\ImmutableHashSet_1.cs (18)
27public static readonly ImmutableHashSet<T> Empty = new ImmutableHashSet<T>(SortedInt32KeyNode<HashBucket>.EmptyNode, EqualityComparer<T>.Default, 0); 47private readonly SortedInt32KeyNode<HashBucket> _root; 59: this(SortedInt32KeyNode<HashBucket>.EmptyNode, equalityComparer, 0) 69private ImmutableHashSet(SortedInt32KeyNode<HashBucket> root, IEqualityComparer<T> equalityComparer, int count) 625SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newRoot = UpdateRoot(origin.Root, hashCode, origin.HashBucketEqualityComparer, newBucket); 638SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newRoot = origin.Root; 676SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newRoot = origin.Root; 699SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newRoot = origin.Root; 765private static SortedInt32KeyNode<HashBucket> UpdateRoot(SortedInt32KeyNode<HashBucket> root, int hashCode, IEqualityComparer<HashBucket> hashBucketEqualityComparer, HashBucket newBucket) 784SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newSet = SortedInt32KeyNode<HashBucket>.EmptyNode; 802private static MutationResult Except(IEnumerable<T> other, IEqualityComparer<T> equalityComparer, IEqualityComparer<HashBucket> hashBucketEqualityComparer, SortedInt32KeyNode<HashBucket> root) 809SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> newRoot = root; 839SortedInt32KeyNode<ImmutableHashSet<T>.HashBucket> result = SortedInt32KeyNode<HashBucket>.EmptyNode; 978private static ImmutableHashSet<T> Wrap(SortedInt32KeyNode<HashBucket> root, IEqualityComparer<T> equalityComparer, int count) 1013private ImmutableHashSet<T> Wrap(SortedInt32KeyNode<HashBucket> root, int adjustedCountIfDifferentRoot)
System\Collections\Immutable\ImmutableHashSet_1.Enumerator.cs (3)
26private SortedInt32KeyNode<HashBucket>.Enumerator _mapEnumerator; 43internal Enumerator(SortedInt32KeyNode<HashBucket> root, Builder? builder = null) 46_mapEnumerator = new SortedInt32KeyNode<HashBucket>.Enumerator(root);
System\Collections\Immutable\ImmutableHashSet_1.MutationInput.cs (3)
22private readonly SortedInt32KeyNode<HashBucket> _root; 59internal MutationInput(SortedInt32KeyNode<HashBucket> root, IEqualityComparer<T> equalityComparer, IEqualityComparer<HashBucket> hashBucketEqualityComparer, int count) 75internal SortedInt32KeyNode<HashBucket> Root
System\Collections\Immutable\ImmutableHashSet_1.MutationResult.cs (3)
35private readonly SortedInt32KeyNode<HashBucket> _root; 55internal MutationResult(SortedInt32KeyNode<HashBucket> root, int count, CountType countType = ImmutableHashSet<T>.CountType.Adjustment) 66internal SortedInt32KeyNode<HashBucket> Root
System\Collections\Immutable\ImmutableHashSet_1.NodeEnumerable.cs (2)
22private readonly SortedInt32KeyNode<HashBucket> _root; 28internal NodeEnumerable(SortedInt32KeyNode<HashBucket> root)
System\Collections\Immutable\SortedInt32KeyNode.cs (43)
27internal static readonly SortedInt32KeyNode<TValue> EmptyNode = new SortedInt32KeyNode<TValue>(); 56private SortedInt32KeyNode<TValue>? _left; 61private SortedInt32KeyNode<TValue>? _right; 64/// Initializes a new instance of the <see cref="SortedInt32KeyNode{TValue}"/> class that is pre-frozen. 72/// Initializes a new instance of the <see cref="SortedInt32KeyNode{TValue}"/> class that is not yet frozen. 79private SortedInt32KeyNode(int key, TValue value, SortedInt32KeyNode<TValue> left, SortedInt32KeyNode<TValue> right, bool frozen = false) 110public SortedInt32KeyNode<TValue>? Left { get { return _left; } } 115public SortedInt32KeyNode<TValue>? Right { get { return _right; } } 158internal SortedInt32KeyNode<TValue> SetItem(int key, TValue value, IEqualityComparer<TValue> valueComparer, out bool replacedExistingValue, out bool mutated) 171internal SortedInt32KeyNode<TValue> Remove(int key, out bool mutated) 183SortedInt32KeyNode<TValue> node = this; 215SortedInt32KeyNode<TValue> node = this; 262private static SortedInt32KeyNode<TValue> RotateLeft(SortedInt32KeyNode<TValue> tree) 272SortedInt32KeyNode<TValue> right = tree._right; 281private static SortedInt32KeyNode<TValue> RotateRight(SortedInt32KeyNode<TValue> tree) 291SortedInt32KeyNode<TValue> left = tree._left; 300private static SortedInt32KeyNode<TValue> DoubleLeft(SortedInt32KeyNode<TValue> tree) 310SortedInt32KeyNode<TValue> rotatedRightChild = tree.Mutate(right: RotateRight(tree._right)); 319private static SortedInt32KeyNode<TValue> DoubleRight(SortedInt32KeyNode<TValue> tree) 329SortedInt32KeyNode<TValue> rotatedLeftChild = tree.Mutate(left: RotateLeft(tree._left)); 338private static int Balance(SortedInt32KeyNode<TValue> tree) 353private static bool IsRightHeavy(SortedInt32KeyNode<TValue> tree) 363private static bool IsLeftHeavy(SortedInt32KeyNode<TValue> tree) 375private static SortedInt32KeyNode<TValue> MakeBalanced(SortedInt32KeyNode<TValue> tree) 403private SortedInt32KeyNode<TValue> SetOrAdd(int key, TValue value, IEqualityComparer<TValue> valueComparer, bool overwriteExistingValue, out bool replacedExistingValue, out bool mutated) 416SortedInt32KeyNode<TValue> result = this; 419SortedInt32KeyNode<TValue> newRight = _right!.SetOrAdd(key, value, valueComparer, overwriteExistingValue, out replacedExistingValue, out mutated); 427SortedInt32KeyNode<TValue> newLeft = _left!.SetOrAdd(key, value, valueComparer, overwriteExistingValue, out replacedExistingValue, out mutated); 462private SortedInt32KeyNode<TValue> RemoveRecursive(int key, out bool mutated) 472SortedInt32KeyNode<TValue> result = this; 497SortedInt32KeyNode<TValue> successor = _right; 503SortedInt32KeyNode<TValue> newRight = _right.Remove(successor._key, out _); 509SortedInt32KeyNode<TValue> newLeft = _left.Remove(key, out mutated); 517SortedInt32KeyNode<TValue> newRight = _right.Remove(key, out mutated); 536private SortedInt32KeyNode<TValue> Mutate(SortedInt32KeyNode<TValue>? left = null, SortedInt32KeyNode<TValue>? right = null)
System\Collections\Immutable\SortedInt32KeyNode.Enumerator.cs (15)
36private SortedInt32KeyNode<TValue> _root; 41private SecurePooledObject<Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>>? _stack; 46private SortedInt32KeyNode<TValue>? _current; 52internal Enumerator(SortedInt32KeyNode<TValue> root) 62if (!SecureObjectPool<Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>, Enumerator>.TryTake(this, out _stack)) 64_stack = SecureObjectPool<Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>, Enumerator>.PrepNew(this, new Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>(root.Height)); 109if (_stack != null && _stack.TryUse(ref this, out Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>? stack)) 112SecureObjectPool<Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>, Enumerator>.TryAdd(this, _stack!); 128Stack<RefAsValueType<SortedInt32KeyNode<TValue>>> stack = _stack.Use(ref this); 131SortedInt32KeyNode<TValue> n = stack.Pop().Value; 152Stack<RefAsValueType<SortedInt32KeyNode<TValue>>> stack = _stack.Use(ref this); 179private void PushLeft(SortedInt32KeyNode<TValue> node) 182Stack<RefAsValueType<SortedInt32KeyNode<TValue>>> stack = _stack!.Use(ref this); 185stack.Push(new RefAsValueType<SortedInt32KeyNode<TValue>>(node));