Cleanup some collection initializations

This commit is contained in:
Jordan Dominion
2023-12-17 23:25:31 -05:00
parent 8c34cf83d9
commit ee16007c64
2 changed files with 4 additions and 5 deletions
@@ -60,13 +60,13 @@ namespace Tgstation.Server.Host.Components.Chat.Providers
/// <summary>
/// The <see cref="ChannelType"/>s supported by the <see cref="DiscordProvider"/> for mapping.
/// </summary>
static readonly ChannelType[] SupportedGuildChannelTypes = new[]
{
static readonly ChannelType[] SupportedGuildChannelTypes =
[
ChannelType.GuildText,
ChannelType.GuildAnnouncement,
ChannelType.PrivateThread,
ChannelType.PublicThread,
};
];
/// <summary>
/// The <see cref="IAssemblyInformationProvider"/> for the <see cref="DiscordProvider"/>.
@@ -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;