From df7751c5d97b510296c88971dc7245b286ba8454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Sun, 11 Feb 2024 17:44:35 -0800 Subject: [PATCH] var for less brackets --- internal/modlist/modlist.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/modlist/modlist.go b/internal/modlist/modlist.go index ed67e6e..08043b3 100644 --- a/internal/modlist/modlist.go +++ b/internal/modlist/modlist.go @@ -29,17 +29,19 @@ type Modlist struct { func (modlist *Modlist) setModStatus(name string, status bool) { for i := range modlist.Mods { - if modlist.Mods[i].Name == name && modlist.Mods[i].Enabled != status { - modlist.Mods[i].Enabled = status - log.Debugf("Setting status of mod %s to %v", modlist.Mods[i].Name, modlist.Mods[i].Enabled) + mod := &modlist.Mods[i] + if mod.Name == name && mod.Enabled != status { + mod.Enabled = status + log.Debugf("Setting status of mod %s to %v", mod.Name, mod.Enabled) } } } func (modlist *Modlist) setAllStatus(status bool) { for i := range modlist.Mods { - modlist.Mods[i].Enabled = status - log.Debugf("Setting status of mod %s to %v", modlist.Mods[i].Name, modlist.Mods[i].Enabled) + mod := &modlist.Mods[i] + mod.Enabled = status + log.Debugf("Setting status of mod %s to %v", mod.Name, mod.Enabled) } }