Preallocate slice

This commit is contained in:
Xpl0itU 2023-08-26 17:06:12 +02:00
parent 5f544a46ab
commit 40d174fd4e

View file

@ -285,7 +285,7 @@ func (mw *MainWindow) ShowAll() {
mw.logger.Fatal("Unable to create box:", err)
}
mw.categoryButtons = make([]*gtk.ToggleButton, 0)
mw.categoryButtons = make([]*gtk.ToggleButton, 5)
for _, cat := range []string{"Game", "Update", "DLC", "Demo", "All"} {
button, err := gtk.ToggleButtonNewWithLabel(cat)
if err != nil {