// walk walks recursively the bolt database db, calling walkFn for each key it finds.
968153
func (cmd *CompactCommand) walk(db *bolt.DB, walkFn walkFunc) error {
	return db.View(func(tx *bolt.Tx) error {
		return tx.ForEach(func(name []byte, b *bolt.Bucket) error {
			return cmd.walkBucket(b, nil, name, nil, b.Sequence(), walkFn)
		})
	})
}
775680
func (n *If) Walk(v walker.Visitor) {
	if v.EnterNode(n) == false {
		return
	}

	if n.Cond != nil {
		v.EnterChildNode("Cond", n)
		n.Cond.Walk(v)
		v.LeaveChildNode("Cond", n)
	}

	if n.Stmt != nil {
		v.EnterChildNode("Stmt", n)
		n.Stmt.Walk(v)
		v.LeaveChildNode("Stmt", n)
	}

	if n.ElseIf != nil {
		v.EnterChildList("ElseIf", n)
		for _, nn := range n.ElseIf {
			if nn != nil {
				nn.Walk(v)
			}
		}
		v.LeaveChildList("ElseIf", n)
	}

	if n.Else != nil {
		v.EnterChildNode("Else", n)
		n.Else.Walk(v)
		v.LeaveChildNode("Else", n)
	}

	v.LeaveNode(n)
}
318407
func (n *Static) Walk(v walker.Visitor) {
	if v.EnterNode(n) == false {
		return
	}

	if n.Vars != nil {
		v.EnterChildList("Vars", n)
		for _, nn := range n.Vars {
			if nn != nil {
				nn.Walk(v)
			}
		}
		v.LeaveChildList("Vars", n)
	}

	v.LeaveNode(n)
}
334320
func (e *Entry) Walk(walkFn filepath.WalkFunc) error {
	return walk(e, "", walkFn)
}
359370
func Walk(t *tree.Tree, ch, quit chan int) {
	walkImpl(t, ch, quit)
	close(ch)
}
1153493
func Walk(v Visitor, n Node) {
	visitor{Visitor: v}.visit(nil, n)
}
1292408
func (n *Echo) Walk(v walker.Visitor) {
	if v.EnterNode(n) == false {
		return
	}

	if n.Exprs != nil {
		v.EnterChildList("Exprs", n)
		for _, nn := range n.Exprs {
			if nn != nil {
				nn.Walk(v)
			}
		}
		v.LeaveChildList("Exprs", n)
	}

	v.LeaveNode(n)
}
1183493
func (n *New) Walk(v walker.Visitor) {
	if v.EnterNode(n) == false {
		return
	}

	if n.Class != nil {
		v.EnterChildNode("Class", n)
		n.Class.Walk(v)
		v.LeaveChildNode("Class", n)
	}

	if n.ArgumentList != nil {
		v.EnterChildNode("ArgumentList", n)
		n.ArgumentList.Walk(v)
		v.LeaveChildNode("ArgumentList", n)
	}

	v.LeaveNode(n)
}
70487
func (p pfx) Walk(ctx context.Context, path string, fn WalkFn) error {
	return p.fs.Walk(ctx, p.addPrefix(path), func(path string) error {
		path = strings.TrimPrefix(path, p.prefix)
		return fn(path)
	})
}
1324484
func (s *storage) Walk(ctx context.Context,
	walker func(packID int, ref blob.Ref, offset int64, size uint32) error) error {

	// TODO(tgulacsi): proper verbose flag from context
	verbose := env.IsDebug()

	for i := 0; i >= 0; i++ {
		fh, err := os.Open(s.filename(i))
		if err != nil {
			if os.IsNotExist(err) {
				break
			}
			return err
		}
		fh.Close()
		if err = s.walkPack(verbose, i, walker); err != nil {
			return err
		}
	}
	return nil
}
270977
func (b *BinaryTree) Walk() []Comparable {
	walked := make([]Comparable, 0, b.size)
	return walkInOrder(b.root, walked)
}
537196
func (t *watcherTree) walk(fn walkFn) {
	t.Tree.Walk(func(prefix string, val interface{}) bool {
		watchers := val.([]*BufferWatcher)
		for _, w := range watchers {
			fn(w)
		}
		return false
	})
}
765199
func (n *TraitUsePrecedence) Walk(v walker.Visitor) {
	if v.EnterNode(n) == false {
		return
	}

	if n.Ref != nil {
		v.EnterChildNode("Ref", n)
		n.Ref.Walk(v)
		v.LeaveChildNode("Ref", n)
	}

	if n.Insteadof != nil {
		v.EnterChildList("Insteadof", n)
		for _, nn := range n.Insteadof {
			if nn != nil {
				nn.Walk(v)
			}
		}
		v.LeaveChildList("Insteadof", n)
	}

	v.LeaveNode(n)
}
582475
func (n *ArgumentList) Walk(v walker.Visitor) {
	if v.EnterNode(n) == false {
		return
	}

	if n.Arguments != nil {
		v.EnterChildList("Arguments", n)
		for _, nn := range n.Arguments {
			if nn != nil {
				nn.Walk(v)
			}
		}
		v.LeaveChildList("Arguments", n)
	}

	v.LeaveNode(n)
}
631161
func (DefaultFs) Walk(root string, walkFn filepath.WalkFunc) error {
	return filepath.Walk(root, walkFn)
}
565413
func (n *ArrayItem) Walk(v walker.Visitor) {
	if v.EnterNode(n) == false {
		return
	}

	if n.Key != nil {
		v.EnterChildNode("Key", n)
		n.Key.Walk(v)
		v.LeaveChildNode("Key", n)
	}

	if n.Val != nil {
		v.EnterChildNode("Val", n)
		n.Val.Walk(v)
		v.LeaveChildNode("Val", n)
	}

	v.LeaveNode(n)
}
648101
func (n *TraitMethodRef) Walk(v walker.Visitor) {
	if v.EnterNode(n) == false {
		return
	}

	if n.Trait != nil {
		v.EnterChildNode("Trait", n)
		n.Trait.Walk(v)
		v.LeaveChildNode("Trait", n)
	}

	if n.Method != nil {
		v.EnterChildNode("Method", n)
		n.Method.Walk(v)
		v.LeaveChildNode("Method", n)
	}

	v.LeaveNode(n)
}