mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-28 07:27:18 +01:00
Apply a bunch of code suggestions
This commit is contained in:
@@ -76,7 +76,7 @@ namespace Tgstation.Server.Api
|
||||
/// <summary>
|
||||
/// A <see cref="char"/> <see cref="Array"/> containing the ':' <see cref="char"/>.
|
||||
/// </summary>
|
||||
static readonly char[] ColonSeparator = new char[] { ':' };
|
||||
static readonly char[] ColonSeparator = [':'];
|
||||
|
||||
/// <summary>
|
||||
/// The instance <see cref="EntityId.Id"/> being accessed.
|
||||
|
||||
@@ -337,7 +337,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
else
|
||||
{
|
||||
totalResults = paginationResult.Results.Count();
|
||||
pagedResults = queriedResults.ToList();
|
||||
pagedResults = [.. queriedResults];
|
||||
}
|
||||
|
||||
ICollection<TResultModel> finalResults;
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace Tgstation.Server.Host.Utils
|
||||
.OrderBy(x => x.PutOnly) // Process PUTs last
|
||||
.ToList();
|
||||
|
||||
if (requestOptions.Any() && requestOptions.All(x => x.Presence == FieldPresence.Ignored && !x.PutOnly))
|
||||
if (requestOptions.Count == 0 && requestOptions.All(x => x.Presence == FieldPresence.Ignored && !x.PutOnly))
|
||||
subSchema.ReadOnly = true;
|
||||
|
||||
var subSchemaId = tuple.Item2;
|
||||
@@ -370,7 +370,7 @@ namespace Tgstation.Server.Host.Utils
|
||||
|
||||
operation.Security = new List<OpenApiSecurityRequirement>
|
||||
{
|
||||
new OpenApiSecurityRequirement
|
||||
new()
|
||||
{
|
||||
{
|
||||
tokenScheme,
|
||||
@@ -450,7 +450,7 @@ namespace Tgstation.Server.Host.Utils
|
||||
|
||||
operation.Security = new List<OpenApiSecurityRequirement>
|
||||
{
|
||||
new OpenApiSecurityRequirement
|
||||
new()
|
||||
{
|
||||
{
|
||||
passwordScheme,
|
||||
|
||||
Reference in New Issue
Block a user