Simpler HasNext()

Hi,

Since we already have a reference to the currentNode, wouldn’t it be even simpler to do

public bool HasNext()
{
return currentNode.GetChildren().Count > 0;
}

?

1 Like

For the time being, yes. Later, we will be filtering the nodes based on conditions, and this method will need to be able to have access to the actual child nodes themselves rather than the string references to the nodes.

1 Like

Privacy & Terms