Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ InOrderTreeWalk()

virtual bool System.Collections.Generic.SortedSet< T >.InOrderTreeWalk ( TreeWalkPredicate< T > action)
inlinepackagevirtualinherited

Reimplemented in System.Collections.Generic.SortedSet< T >.TreeSubSet.

Definition at line 841 of file SortedSet.cs.

842 {
843 if (root == null)
844 {
845 return true;
846 }
847 Stack<Node> stack = new Stack<Node>(2 * Log2(Count + 1));
848 for (Node left = root; left != null; left = left.Left)
849 {
850 stack.Push(left);
851 }
852 while (stack.Count != 0)
853 {
854 Node left = stack.Pop();
855 if (!action(left))
856 {
857 return false;
858 }
859 for (Node node = left.Right; node != null; node = node.Left)
860 {
861 stack.Push(node);
862 }
863 }
864 return true;
865 }

References System.action, System.Collections.Generic.SortedSet< T >.Count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Runtime.Serialization.Dictionary, System.Collections.Generic.SortedSet< T >.Node.Left, System.Collections.Generic.SortedSet< T >.Log2(), System.Collections.Generic.SortedSet< T >.Node.Right, and System.Collections.Generic.SortedSet< T >.root.

Referenced by System.Collections.Generic.SortedSet< T >.CopyTo(), and System.Collections.Generic.SortedSet< T >.CopyTo().