From 4891cfddabcc6dfa8be6d621b6a1bcdee7318c1e Mon Sep 17 00:00:00 2001 From: K4ryuu <104531589+K4ryuu@users.noreply.github.com> Date: Sat, 11 May 2024 18:56:31 +0200 Subject: [PATCH] fix: Simplify add ranges --- K4-System/src/Plugin/PluginBasics.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/K4-System/src/Plugin/PluginBasics.cs b/K4-System/src/Plugin/PluginBasics.cs index 44a3fa9..e9a4088 100644 --- a/K4-System/src/Plugin/PluginBasics.cs +++ b/K4-System/src/Plugin/PluginBasics.cs @@ -36,32 +36,31 @@ public void Initialize_Commands() { string rankLocale = Localizer["k4.general.availablecommands.rank"]; - commandCategories[rankLocale] = new List(); - commandCategories[rankLocale].AddRange(commands.RankCommands); - commandCategories[rankLocale].AddRange(commands.TopCommands); - commandCategories[rankLocale].AddRange(commands.RanksCommands); + commandCategories[rankLocale] = + [ + .. commands.RankCommands, + .. commands.TopCommands, + .. commands.RanksCommands, + ]; } if (Config.GeneralSettings.ModuleStats) { string statLocale = Localizer["k4.general.availablecommands.stat"]; - commandCategories[statLocale] = new List(); - commandCategories[statLocale].AddRange(commands.StatCommands); + commandCategories[statLocale] = [.. commands.StatCommands]; } if (Config.GeneralSettings.ModuleTimes) { string timeLocale = Localizer["k4.general.availablecommands.time"]; - commandCategories[timeLocale] = new List(); - commandCategories[timeLocale].AddRange(commands.TimeCommands); + commandCategories[timeLocale] = [.. commands.TimeCommands]; } string otherLocale = Localizer["k4.general.availablecommands.other"]; - commandCategories[otherLocale] = new List(); - commandCategories[otherLocale].AddRange(commands.ResetMyCommands); + commandCategories[otherLocale] = [.. commands.ResetMyCommands]; if (Config.GeneralSettings.ModuleUtils) commandCategories[otherLocale].AddRange(commands.AdminListCommands);