From ba3994a97e7ab51191833e4da96e20a1b4e3c6df Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Fri, 27 Aug 2021 16:10:28 +1000 Subject: [PATCH] it's shorter --- engine/game.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/engine/game.go b/engine/game.go index fb14165..fce5675 100644 --- a/engine/game.go +++ b/engine/game.go @@ -63,9 +63,7 @@ func (g *Game) registerComponent(c interface{}, path []interface{}) error { continue } // TODO: sub-quadratic? - k := dexKey{c, b} - g.dex[k] = append(g.dex[k], c) - for _, p := range path { + for _, p := range append(path, c) { k := dexKey{p, b} g.dex[k] = append(g.dex[k], c) }