private void GoToLeftMostLeaf()
{
while (currentNode.contents == null)
{
if (currentNode.height == 0)
{
// this is a function node - move to its contained rope
currentNode = currentNode.GetContentNode();
continue;
}
Debug.Assert(currentNode.right != null);
stack.Push(currentNode.right);
currentNode = currentNode.left;
}
Debug.Assert(currentNode.height == 0);
}