premature optimisation go brrr
This commit is contained in:
parent
b65e5043ab
commit
5b457eded1
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ func (g *Game) Scan() []interface{} { return []interface{}{g.Root} }
|
||||||
// Walk calls v with every path of components reachable from c via Scan, for as
|
// Walk calls v with every path of components reachable from c via Scan, for as
|
||||||
// long as visit returns nil.
|
// long as visit returns nil.
|
||||||
func Walk(c interface{}, v func(interface{}, []interface{}) error) error {
|
func Walk(c interface{}, v func(interface{}, []interface{}) error) error {
|
||||||
return walk(c, nil, v)
|
return walk(c, make([]interface{}, 0, 16), v)
|
||||||
}
|
}
|
||||||
|
|
||||||
func walk(c interface{}, p []interface{}, v func(interface{}, []interface{}) error) error {
|
func walk(c interface{}, p []interface{}, v func(interface{}, []interface{}) error) error {
|
||||||
|
|
Loading…
Reference in a new issue