Skip to content
This repository was archived by the owner on Jan 25, 2025. It is now read-only.

Commit 4891cfd

Browse files
committed
fix: Simplify add ranges
1 parent c5dd9c2 commit 4891cfd

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

K4-System/src/Plugin/PluginBasics.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,31 @@ public void Initialize_Commands()
3636
{
3737
string rankLocale = Localizer["k4.general.availablecommands.rank"];
3838

39-
commandCategories[rankLocale] = new List<string>();
40-
commandCategories[rankLocale].AddRange(commands.RankCommands);
41-
commandCategories[rankLocale].AddRange(commands.TopCommands);
42-
commandCategories[rankLocale].AddRange(commands.RanksCommands);
39+
commandCategories[rankLocale] =
40+
[
41+
.. commands.RankCommands,
42+
.. commands.TopCommands,
43+
.. commands.RanksCommands,
44+
];
4345
}
4446

4547
if (Config.GeneralSettings.ModuleStats)
4648
{
4749
string statLocale = Localizer["k4.general.availablecommands.stat"];
4850

49-
commandCategories[statLocale] = new List<string>();
50-
commandCategories[statLocale].AddRange(commands.StatCommands);
51+
commandCategories[statLocale] = [.. commands.StatCommands];
5152
}
5253

5354
if (Config.GeneralSettings.ModuleTimes)
5455
{
5556
string timeLocale = Localizer["k4.general.availablecommands.time"];
5657

57-
commandCategories[timeLocale] = new List<string>();
58-
commandCategories[timeLocale].AddRange(commands.TimeCommands);
58+
commandCategories[timeLocale] = [.. commands.TimeCommands];
5959
}
6060

6161
string otherLocale = Localizer["k4.general.availablecommands.other"];
6262

63-
commandCategories[otherLocale] = new List<string>();
64-
commandCategories[otherLocale].AddRange(commands.ResetMyCommands);
63+
commandCategories[otherLocale] = [.. commands.ResetMyCommands];
6564

6665
if (Config.GeneralSettings.ModuleUtils)
6766
commandCategories[otherLocale].AddRange(commands.AdminListCommands);

0 commit comments

Comments
 (0)