3 writes to _left
System.Collections.Immutable (3)
System\Collections\Immutable\ImmutableList_1.Node.cs (3)
89
_left
= left;
1454
_left
= left;
1479
_left
= left;
60 references to _left
System.Collections.Immutable (60)
System\Collections\Immutable\ImmutableList_1.Node.cs (60)
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);
663
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.
666
return
_left
.BinarySearch(index, count, item, comparer);
699
int result =
_left
.BinarySearch(index, count, item, comparer);
1265
_left
!.Freeze();
1282
return _right.MutateLeft(this.MutateRight(_right.
_left
!));
1292
Debug.Assert(!
_left
!.IsEmpty);
1294
return
_left
.MutateRight(this.MutateLeft(
_left
._right!));
1305
Debug.Assert(!_right!.
_left
!.IsEmpty);
1309
Node rightLeft = right.
_left
;
1311
left: this.MutateRight(rightLeft.
_left
!),
1322
Debug.Assert(!
_left
!.IsEmpty);
1323
Debug.Assert(!
_left
._right!.IsEmpty);
1326
Node left =
_left
;
1329
left: left.MutateRight(leftRight.
_left
!),
1344
return _right!._height -
_left
!._height;
1387
return
_left
!.BalanceFactor > 0 ? this.DoubleRight() : this.RotateRight();
1413
Debug.Assert(tree.
_left
!= null && tree._right != null);
1419
Debug.Assert(tree.
_left
!= null);
1420
tree.MutateLeft(tree.
_left
.BalanceMany());
1499
return new Node(_key,
_left
!, right);
1504
_height = ParentHeight(
_left
!, right);
1505
_count = ParentCount(
_left
!, right);
1539
return new Node(key,
_left
!, _right!);
1586
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));