From 5b457eded18af9b3674d5f6821dd97e6ae6a4cbf Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Fri, 27 Aug 2021 14:07:21 +1000 Subject: [PATCH] premature optimisation go brrr --- engine/game.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/game.go b/engine/game.go index 0b7784b..f166509 100644 --- a/engine/game.go +++ b/engine/game.go @@ -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 // long as visit returns nil. 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 {