From ee16007c64a21c69cd674a4f1fd09c61fc47e11a Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sun, 17 Dec 2023 21:47:38 -0500 Subject: [PATCH] Cleanup some collection initializations --- .../Components/Chat/Providers/DiscordProvider.cs | 6 +++--- src/Tgstation.Server.Host/Core/Application.cs | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs b/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs index 3b3b4699d3..20432e68d0 100644 --- a/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs +++ b/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs @@ -60,13 +60,13 @@ namespace Tgstation.Server.Host.Components.Chat.Providers /// /// The s supported by the for mapping. /// - static readonly ChannelType[] SupportedGuildChannelTypes = new[] - { + static readonly ChannelType[] SupportedGuildChannelTypes = + [ ChannelType.GuildText, ChannelType.GuildAnnouncement, ChannelType.PrivateThread, ChannelType.PublicThread, - }; + ]; /// /// The for the . diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs index 03e14ed6a2..202b098d7c 100644 --- a/src/Tgstation.Server.Host/Core/Application.cs +++ b/src/Tgstation.Server.Host/Core/Application.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.Linq; using System.Threading.Tasks; using Cyberboss.AspNetCore.AsyncInitializer; @@ -546,7 +545,7 @@ namespace Tgstation.Server.Host.Core else if (controlPanelConfiguration.AllowedOrigins?.Count > 0) { logger.LogTrace("Access-Control-Allow-Origin: {allowedOrigins}", String.Join(',', controlPanelConfiguration.AllowedOrigins)); - corsBuilder = builder => builder.WithOrigins(controlPanelConfiguration.AllowedOrigins.ToArray()); + corsBuilder = builder => builder.WithOrigins([.. controlPanelConfiguration.AllowedOrigins]); } var originalBuilder = corsBuilder;