Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,29 @@ protected virtual bool GetLeftIsChildValue(TLinkAddress value)
//return Bit<TLinkAddress>.PartialRead(value != 4, 1, default);
}

/// <summary>
/// <para>
/// Determines whether the left child of a node is a child (not a thread) using size comparison.
/// </para>
/// <para></para>
/// </summary>
/// <param name="node">
/// <para>The node.</para>
/// <para></para>
/// </param>
/// <returns>
/// <para>The bool</para>
/// <para></para>
/// </returns>
[MethodImpl(methodImplOptions: MethodImplOptions.AggressiveInlining)]
protected virtual bool GetLeftIsChildBySizeComparison(TLinkAddress node)
{
var nodeSize = GetSize(node);
var left = GetLeft(node);
var leftSize = GetSizeOrZero(left);
return leftSize > TLinkAddress.Zero && nodeSize > leftSize;
}

/// <summary>
/// <para>
/// Sets the left is child value using the specified stored value.
Expand Down Expand Up @@ -567,6 +590,29 @@ protected virtual bool GetRightIsChildValue(TLinkAddress value)
//return Bit<TLinkAddress>.PartialRead(value != 3, 1, default);
}

/// <summary>
/// <para>
/// Determines whether the right child of a node is a child (not a thread) using size comparison.
/// </para>
/// <para></para>
/// </summary>
/// <param name="node">
/// <para>The node.</para>
/// <para></para>
/// </param>
/// <returns>
/// <para>The bool</para>
/// <para></para>
/// </returns>
[MethodImpl(methodImplOptions: MethodImplOptions.AggressiveInlining)]
protected virtual bool GetRightIsChildBySizeComparison(TLinkAddress node)
{
var nodeSize = GetSize(node);
var right = GetRight(node);
var rightSize = GetSizeOrZero(right);
return rightSize > TLinkAddress.Zero && nodeSize > rightSize;
}

/// <summary>
/// <para>
/// Sets the right is child value using the specified stored value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public LinksSourcesAvlBalancedTreeMethods(LinksConstants<TLinkAddress> constants

/// <summary>
/// <para>
/// Determines whether this instance get left is child.
/// Determines whether this instance get left is child using size comparison.
/// </para>
/// <para></para>
/// </summary>
Expand All @@ -186,7 +186,7 @@ public LinksSourcesAvlBalancedTreeMethods(LinksConstants<TLinkAddress> constants
/// <para></para>
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected override bool GetLeftIsChild(TLinkAddress node) => GetLeftIsChildValue(GetLinkReference(node).SizeAsSource);
protected override bool GetLeftIsChild(TLinkAddress node) => GetLeftIsChildBySizeComparison(node);

/// <summary>
/// <para>
Expand All @@ -207,7 +207,7 @@ public LinksSourcesAvlBalancedTreeMethods(LinksConstants<TLinkAddress> constants

/// <summary>
/// <para>
/// Determines whether this instance get right is child.
/// Determines whether this instance get right is child using size comparison.
/// </para>
/// <para></para>
/// </summary>
Expand All @@ -220,7 +220,7 @@ public LinksSourcesAvlBalancedTreeMethods(LinksConstants<TLinkAddress> constants
/// <para></para>
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected override bool GetRightIsChild(TLinkAddress node) => GetRightIsChildValue(GetLinkReference(node).SizeAsSource);
protected override bool GetRightIsChild(TLinkAddress node) => GetRightIsChildBySizeComparison(node);

/// <summary>
/// <para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public LinksTargetsAvlBalancedTreeMethods(LinksConstants<TLinkAddress> constants

/// <summary>
/// <para>
/// Determines whether this instance get left is child.
/// Determines whether this instance get left is child using size comparison.
/// </para>
/// <para></para>
/// </summary>
Expand All @@ -186,7 +186,7 @@ public LinksTargetsAvlBalancedTreeMethods(LinksConstants<TLinkAddress> constants
/// <para></para>
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected override bool GetLeftIsChild(TLinkAddress node) => GetLeftIsChildValue(GetLinkReference(node).SizeAsTarget);
protected override bool GetLeftIsChild(TLinkAddress node) => GetLeftIsChildBySizeComparison(node);

/// <summary>
/// <para>
Expand All @@ -207,7 +207,7 @@ public LinksTargetsAvlBalancedTreeMethods(LinksConstants<TLinkAddress> constants

/// <summary>
/// <para>
/// Determines whether this instance get right is child.
/// Determines whether this instance get right is child using size comparison.
/// </para>
/// <para></para>
/// </summary>
Expand All @@ -220,7 +220,7 @@ public LinksTargetsAvlBalancedTreeMethods(LinksConstants<TLinkAddress> constants
/// <para></para>
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected override bool GetRightIsChild(TLinkAddress node) => GetRightIsChildValue(GetLinkReference(node).SizeAsTarget);
protected override bool GetRightIsChild(TLinkAddress node) => GetRightIsChildBySizeComparison(node);

/// <summary>
/// <para>
Expand Down
Loading