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