4 instantiations of Node
System.Collections.Immutable (4)
System\Collections\Immutable\ImmutableSortedSet_1.Node.cs (4)
21internal static readonly Node EmptyNode = new Node(); 346return new Node(key, this, this); 736return new Node(items[start + leftCount], left, right, true); 751return new Node(_key, left ?? _left, right ?? _right);
85 references to Node
System.Collections.Immutable (85)
System\Collections\Immutable\ImmutableSortedSet_1.Builder.cs (9)
36private ImmutableSortedSet<T>.Node _root = ImmutableSortedSet<T>.Node.EmptyNode; 155ImmutableSortedSet<T>.Node newRoot = Node.EmptyNode; 180private Node Root 241ImmutableSortedSet<T>.Node result = ImmutableSortedSet<T>.Node.EmptyNode; 352this.Root = ImmutableSortedSet<T>.Node.EmptyNode; 470Node searchResult = _root.Search(equalValue, _comparer);
System\Collections\Immutable\ImmutableSortedSet_1.cs (16)
44private readonly Node _root; 57_root = Node.EmptyNode; 66private ImmutableSortedSet(Node root, IComparer<T> comparer) 206Node searchResult = _root.Search(equalValue, _comparer); 246ImmutableSortedSet<T>.Node result = _root; 357var result = new ImmutableSortedSet<T>(Node.EmptyNode, comparer); 1025private static ImmutableSortedSet<T> Wrap(Node root, IComparer<T> comparer) 1049ImmutableSortedSet<T>.Node result = _root; 1073ImmutableSortedSet<T>.Node result = _root; 1087private ImmutableSortedSet<T> Wrap(Node root) 1160Node root = Node.NodeTreeFromList(list.AsReadOnlyList(), 0, list.Count); 1218Node root = Node.NodeTreeFromList(list.AsReadOnlyList(), 0, list.Count); 1230private readonly Node _root; 1236internal ReverseEnumerable(Node root)
System\Collections\Immutable\ImmutableSortedSet_1.Enumerator.cs (15)
46private Node _root; 59private SecurePooledObject<Stack<RefAsValueType<Node>>>? _stack; 64private Node? _current; 77internal Enumerator(Node root, Builder? builder = null, bool reverse = false) 88if (!SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.TryTake(this, out _stack)) 90_stack = SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.PrepNew(this, new Stack<RefAsValueType<Node>>(root.Height)); 134if (_stack != null && _stack.TryUse(ref this, out Stack<RefAsValueType<Node>>? stack)) 137SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.TryAdd(this, _stack!); 151Stack<RefAsValueType<ImmutableSortedSet<T>.Node>> stack = _stack!.Use(ref this); 154Node n = stack.Pop().Value; 175Stack<RefAsValueType<ImmutableSortedSet<T>.Node>> stack = _stack!.Use(ref this); 213private void PushNext(Node node) 216Stack<RefAsValueType<ImmutableSortedSet<T>.Node>> stack = _stack!.Use(ref this); 219stack.Push(new RefAsValueType<Node>(node));
System\Collections\Immutable\ImmutableSortedSet_1.Node.cs (45)
21internal static readonly Node EmptyNode = new Node(); 56private Node? _left; 61private Node? _right; 64/// Initializes a new instance of the <see cref="ImmutableSortedSet{T}.Node"/> class 74/// Initializes a new instance of the <see cref="ImmutableSortedSet{T}.Node"/> class 81private Node(T key, Node left, Node right, bool frozen = false) 117public Node? Left 125public Node? Right 164Node n = this; 187Node n = this; 339internal Node Add(T key, IComparer<T> comparer, out bool mutated) 350Node result = this; 354ImmutableSortedSet<T>.Node newRight = _right!.Add(key, comparer, out mutated); 362ImmutableSortedSet<T>.Node newLeft = _left!.Add(key, comparer, out mutated); 385internal Node Remove(T key, IComparer<T> comparer, out bool mutated) 397Node result = this; 423ImmutableSortedSet<T>.Node successor = _right; 429ImmutableSortedSet<T>.Node newRight = _right.Remove(successor._key, comparer, out _); 435ImmutableSortedSet<T>.Node newLeft = _left.Remove(key, comparer, out mutated); 443ImmutableSortedSet<T>.Node newRight = _right.Remove(key, comparer, out mutated); 489internal Node Search(T key, IComparer<T> comparer) 581private static Node RotateLeft(Node tree) 591ImmutableSortedSet<T>.Node right = tree._right; 600private static Node RotateRight(Node tree) 610ImmutableSortedSet<T>.Node left = tree._left; 619private static Node DoubleLeft(Node tree) 629Node rotatedRightChild = tree.Mutate(right: RotateRight(tree._right)); 638private static Node DoubleRight(Node tree) 648Node rotatedLeftChild = tree.Mutate(left: RotateLeft(tree._left)); 657private static int Balance(Node tree) 672private static bool IsRightHeavy(Node tree) 682private static bool IsLeftHeavy(Node tree) 694private static Node MakeBalanced(Node tree) 721internal static Node NodeTreeFromList(IReadOnlyList<T> items, int start, int length) 734Node left = NodeTreeFromList(items, start, leftCount); 735Node right = NodeTreeFromList(items, start + leftCount + 1, rightCount); 746private Node Mutate(Node? left = null, Node? right = null)