3 writes to _left
System.Collections.Immutable (3)
System\Collections\Immutable\ImmutableList_1.Node.cs (3)
89
_left
= left;
1477
_left
= left;
1502
_left
= left;
61 references to _left
System.Collections.Immutable (61)
System\Collections\Immutable\ImmutableList_1.Node.cs (61)
108
Debug.Assert(!(
_left
== null ^ _right == null));
109
return
_left
== null;
121
public Node? Left =>
_left
;
153
Debug.Assert(
_left
!= null && _right != null);
155
if (index <
_left
._count)
157
return
_left
[index];
160
if (index >
_left
._count)
162
return _right[index -
_left
._count - 1];
183
Debug.Assert(
_left
!= null && _right != null);
184
if (index <
_left
._count)
186
return ref
_left
.ItemRefUnchecked(index);
189
if (index >
_left
._count)
191
return ref _right.ItemRefUnchecked(index -
_left
._count - 1);
312
if (index <=
_left
!._count)
314
Node newLeft =
_left
.Insert(index, key);
320
Node newRight = _right!.Insert(index -
_left
._count - 1, key);
379
if (index <=
_left
!._count)
381
Node newLeft =
_left
.InsertRange(index, keys);
386
Node newRight = _right!.InsertRange(index -
_left
._count - 1, keys);
401
Debug.Assert(
_left
!= null && _right != null);
404
if (index ==
_left
._count)
409
if (_right.IsEmpty &&
_left
.IsEmpty)
413
else if (_right.IsEmpty && !
_left
.IsEmpty)
415
result =
_left
;
417
else if (!_right.IsEmpty &&
_left
.IsEmpty)
426
while (!successor.
_left
!.IsEmpty)
428
successor = successor.
_left
;
432
result = successor.MutateBoth(left:
_left
, right: newRight);
435
else if (index <
_left
._count)
437
ImmutableList<T>.Node newLeft =
_left
.RemoveAt(index);
442
ImmutableList<T>.Node newRight = _right.RemoveAt(index -
_left
._count - 1);
504
if (index ==
_left
!._count)
509
else if (index <
_left
._count)
511
ImmutableList<T>.Node newLeft =
_left
.ReplaceAt(index, value);
516
ImmutableList<T>.Node newRight = _right!.ReplaceAt(index -
_left
._count - 1, value);
535
return this.MutateBoth(_right!.Reverse(),
_left
!.Reverse());
677
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.
680
return
_left
.BinarySearch(index, count, item, comparer);
713
int result =
_left
.BinarySearch(index, count, item, comparer);
1288
_left
!.Freeze();
1305
return _right.MutateLeft(this.MutateRight(_right.
_left
!));
1315
Debug.Assert(!
_left
!.IsEmpty);
1317
return
_left
.MutateRight(this.MutateLeft(
_left
._right!));
1328
Debug.Assert(!_right!.
_left
!.IsEmpty);
1332
Node rightLeft = right.
_left
;
1334
left: this.MutateRight(rightLeft.
_left
!),
1345
Debug.Assert(!
_left
!.IsEmpty);
1346
Debug.Assert(!
_left
._right!.IsEmpty);
1349
Node left =
_left
;
1352
left: left.MutateRight(leftRight.
_left
!),
1367
return _right!._height -
_left
!._height;
1410
return
_left
!.BalanceFactor > 0 ? this.DoubleRight() : this.RotateRight();
1436
Debug.Assert(tree.
_left
!= null && tree._right != null);
1442
Debug.Assert(tree.
_left
!= null);
1443
tree.MutateLeft(tree.
_left
.BalanceMany());
1522
return new Node(_key,
_left
!, right);
1527
_height = ParentHeight(
_left
!, right);
1528
_count = ParentCount(
_left
!, right);
1562
return new Node(key,
_left
!, _right!);
1609
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));