Fix walk with non-container root nodes

When passed a non-container root node, the former algorithm would go on
walking down the rest of the tree beyond the root.

The former walk fix was supposed to do that but somehow the code
disappeared in the process.
This commit is contained in:
Pierre Neidhardt 2016-10-05 09:43:05 +05:30
parent 6141d5fde1
commit 14a0c487b8
1 changed files with 1 additions and 1 deletions

View File

@ -309,7 +309,7 @@ func newNodeWalker(root *Node) *nodeWalker {
}
func (nw *nodeWalker) next() {
if !nw.entering && nw.current == nw.root {
if (!nw.current.isContainer() || !nw.entering) && nw.current == nw.root {
nw.current = nil
return
}