3 writes to _left
System.Collections.Immutable (3)
System\Collections\Immutable\ImmutableList_1.Node.cs (3)
89
_left
= left;
1474
_left
= left;
1499
_left
= left;
62 references to _left
System.Collections.Immutable (62)
System\Collections\Immutable\ImmutableList_1.Node.cs (62)
108
Debug.Assert(!(
_left
== null ^ _right == null));
109
return
_left
== null;
121
public Node? Left =>
_left
;
126
IBinaryTree? IBinaryTree.Left =>
_left
;
141
IBinaryTree<T>? IBinaryTree<T>.Left =>
_left
;
173
Debug.Assert(
_left
!= null && _right != null);
175
if (index <
_left
._count)
177
return
_left
[index];
180
if (index >
_left
._count)
182
return _right[index -
_left
._count - 1];
203
Debug.Assert(
_left
!= null && _right != null);
204
if (index <
_left
._count)
206
return ref
_left
.ItemRefUnchecked(index);
209
if (index >
_left
._count)
211
return ref _right.ItemRefUnchecked(index -
_left
._count - 1);
332
if (index <=
_left
!._count)
334
Node newLeft =
_left
.Insert(index, key);
340
Node newRight = _right!.Insert(index -
_left
._count - 1, key);
399
if (index <=
_left
!._count)
401
Node newLeft =
_left
.InsertRange(index, keys);
406
Node newRight = _right!.InsertRange(index -
_left
._count - 1, keys);
421
Debug.Assert(
_left
!= null && _right != null);
424
if (index ==
_left
._count)
429
if (_right.IsEmpty &&
_left
.IsEmpty)
433
else if (_right.IsEmpty && !
_left
.IsEmpty)
435
result =
_left
;
437
else if (!_right.IsEmpty &&
_left
.IsEmpty)
446
while (!successor.
_left
!.IsEmpty)
448
successor = successor.
_left
;
452
result = successor.MutateBoth(left:
_left
, right: newRight);
455
else if (index <
_left
._count)
457
ImmutableList<T>.Node newLeft =
_left
.RemoveAt(index);
462
ImmutableList<T>.Node newRight = _right.RemoveAt(index -
_left
._count - 1);
524
if (index ==
_left
!._count)
529
else if (index <
_left
._count)
531
ImmutableList<T>.Node newLeft =
_left
.ReplaceAt(index, value);
536
ImmutableList<T>.Node newRight = _right!.ReplaceAt(index -
_left
._count - 1, value);
683
int thisNodeIndex =
_left
!.Count; // this is only the index within the AVL tree, treating this node as root rather than a member of a larger tree.
686
return
_left
.BinarySearch(index, count, item, comparer);
719
int result =
_left
.BinarySearch(index, count, item, comparer);
1285
_left
!.Freeze();
1302
return _right.MutateLeft(this.MutateRight(_right.
_left
!));
1312
Debug.Assert(!
_left
!.IsEmpty);
1314
return
_left
.MutateRight(this.MutateLeft(
_left
._right!));
1325
Debug.Assert(!_right!.
_left
!.IsEmpty);
1329
Node rightLeft = right.
_left
;
1331
left: this.MutateRight(rightLeft.
_left
!),
1342
Debug.Assert(!
_left
!.IsEmpty);
1343
Debug.Assert(!
_left
._right!.IsEmpty);
1346
Node left =
_left
;
1349
left: left.MutateRight(leftRight.
_left
!),
1364
return _right!._height -
_left
!._height;
1407
return
_left
!.BalanceFactor > 0 ? this.DoubleRight() : this.RotateRight();
1433
Debug.Assert(tree.
_left
!= null && tree._right != null);
1439
Debug.Assert(tree.
_left
!= null);
1440
tree.MutateLeft(tree.
_left
.BalanceMany());
1519
return new Node(_key,
_left
!, right);
1524
_height = ParentHeight(
_left
!, right);
1525
_count = ParentCount(
_left
!, right);
1559
return new Node(key,
_left
!, _right!);
1606
private static bool Contains(Node node, T value, IEqualityComparer<T> equalityComparer) => !node.IsEmpty && (equalityComparer.Equals(value, node._key) || Contains(node.
_left
!, value, equalityComparer) || Contains(node._right!, value, equalityComparer));