diff options
Diffstat (limited to 'Ryujinx.Common/Collections/IntervalTree.cs')
-rw-r--r-- | Ryujinx.Common/Collections/IntervalTree.cs | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/Ryujinx.Common/Collections/IntervalTree.cs b/Ryujinx.Common/Collections/IntervalTree.cs index e1b81f4e..514fd534 100644 --- a/Ryujinx.Common/Collections/IntervalTree.cs +++ b/Ryujinx.Common/Collections/IntervalTree.cs @@ -1,7 +1,5 @@ using System; -using System.Collections; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Ryujinx.Common.Collections @@ -212,7 +210,7 @@ namespace Ryujinx.Common.Collections /// <param name="overlaps">Overlaps array to place results in</param> /// <param name="overlapCount">Overlaps count to update</param> private void GetValues(IntervalTreeNode<K, V> node, K start, K end, ref V[] overlaps, ref int overlapCount) - { + { if (node == null || start.CompareTo(node.Max) >= 0) { return; @@ -624,7 +622,7 @@ namespace Ryujinx.Common.Collections node.Right = LeftOf(right); if (node.Right != null) { - node.Right.Parent = node; + node.Right.Parent = node; } IntervalTreeNode<K, V> nodeParent = ParentOf(node); right.Parent = nodeParent; @@ -638,7 +636,7 @@ namespace Ryujinx.Common.Collections } else { - nodeParent.Right = right; + nodeParent.Right = right; } right.Left = node; node.Parent = right; @@ -779,37 +777,37 @@ namespace Ryujinx.Common.Collections /// </summary> /// <typeparam name="K">Key type of the node</typeparam> /// <typeparam name="V">Value type of the node</typeparam> - internal class IntervalTreeNode<K, V> + class IntervalTreeNode<K, V> { - internal bool Color = true; - internal IntervalTreeNode<K, V> Left = null; - internal IntervalTreeNode<K, V> Right = null; - internal IntervalTreeNode<K, V> Parent = null; + public bool Color = true; + public IntervalTreeNode<K, V> Left = null; + public IntervalTreeNode<K, V> Right = null; + public IntervalTreeNode<K, V> Parent = null; /// <summary> /// The start of the range. /// </summary> - internal K Start; + public K Start; /// <summary> /// The end of the range - maximum of all in the Values list. /// </summary> - internal K End; + public K End; /// <summary> /// The maximum end value of this node and all its children. /// </summary> - internal K Max; + public K Max; - internal List<RangeNode<K, V>> Values; + public List<RangeNode<K, V>> Values; public IntervalTreeNode(K start, K end, V value, IntervalTreeNode<K, V> parent) { - this.Start = start; - this.End = end; - this.Max = end; - this.Values = new List<RangeNode<K, V>> { new RangeNode<K, V>(start, end, value) }; - this.Parent = parent; + Start = start; + End = end; + Max = end; + Values = new List<RangeNode<K, V>> { new RangeNode<K, V>(start, end, value) }; + Parent = parent; } } } |