8[DebuggerDisplay(
"{_key} = {_value}")]
64 value.ClearFastWhenEmpty();
93 stack.ClearFastWhenEmpty();
110 while (!
node.IsEmpty)
144 int IBinaryTree.Count
206 return default(TValue);
224 value =
default(TValue);
251 if (
tree._right.IsEmpty)
256 return right.Mutate(
tree.Mutate(
null, right._left));
262 if (
tree._left.IsEmpty)
267 return left.Mutate(
null,
tree.Mutate(left._right));
273 if (
tree._right.IsEmpty)
284 if (
tree._left.IsEmpty)
295 return tree._right._height -
tree._left._height;
Enumerator GetEnumerator()
SortedInt32KeyNode(int key, TValue value, SortedInt32KeyNode< TValue > left, SortedInt32KeyNode< TValue > right, bool frozen=false)
SortedInt32KeyNode< TValue > RemoveRecursive(int key, out bool mutated)
SortedInt32KeyNode< TValue >? Right
static bool IsRightHeavy(SortedInt32KeyNode< TValue > tree)
static bool IsLeftHeavy(SortedInt32KeyNode< TValue > tree)
SortedInt32KeyNode< TValue > _right
SortedInt32KeyNode< TValue > _left
IEnumerable< TValue > Values
SortedInt32KeyNode< TValue > Mutate(SortedInt32KeyNode< TValue > left=null, SortedInt32KeyNode< TValue > right=null)
static SortedInt32KeyNode< TValue > MakeBalanced(SortedInt32KeyNode< TValue > tree)
void Freeze(Action< KeyValuePair< int, TValue > >? freezeAction=null)
SortedInt32KeyNode< TValue > Remove(int key, out bool mutated)
static SortedInt32KeyNode< TValue > DoubleRight(SortedInt32KeyNode< TValue > tree)
SortedInt32KeyNode< TValue >? Left
bool TryGetValue(int key, [MaybeNullWhen(false)] out TValue value)
static int Balance(SortedInt32KeyNode< TValue > tree)
SortedInt32KeyNode< TValue > SetItem(int key, TValue value, IEqualityComparer< TValue > valueComparer, out bool replacedExistingValue, out bool mutated)
static SortedInt32KeyNode< TValue > RotateLeft(SortedInt32KeyNode< TValue > tree)
static SortedInt32KeyNode< TValue > DoubleLeft(SortedInt32KeyNode< TValue > tree)
static readonly SortedInt32KeyNode< TValue > EmptyNode
SortedInt32KeyNode< TValue > SetOrAdd(int key, TValue value, IEqualityComparer< TValue > valueComparer, bool overwriteExistingValue, out bool replacedExistingValue, out bool mutated)
static SortedInt32KeyNode< TValue > RotateRight(SortedInt32KeyNode< TValue > tree)
TValue? GetValueOrDefault(int key)
KeyValuePair< int, TValue > Value
static byte Max(byte val1, byte val2)
static string Format(string resourceFormat, object p1)
static string DuplicateKey
SecurePooledObject< Stack< RefAsValueType< SortedInt32KeyNode< TValue > > > > _stack
void PushLeft(SortedInt32KeyNode< TValue > node)
SortedInt32KeyNode< TValue > _root
Enumerator(SortedInt32KeyNode< TValue > root)
object IEnumerator. Current
KeyValuePair< int, TValue > Current
static readonly SecureObjectPool< Stack< RefAsValueType< SortedInt32KeyNode< TValue > > >, Enumerator > s_enumeratingStacks
SortedInt32KeyNode< TValue > _current