Fix CA1310, CA1311

This commit is contained in:
RoosterDragon
2023-03-12 15:44:49 +00:00
committed by Matthias Mailänder
parent d83e579dfe
commit 285443f10f
43 changed files with 80 additions and 67 deletions

View File

@@ -150,7 +150,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (buildable != null)
{
var prerequisites = buildable.Prerequisites.Select(a => ActorName(modData.DefaultRules, a))
.Where(s => !s.StartsWith("~", StringComparison.Ordinal) && !s.StartsWith("!", StringComparison.Ordinal));
.Where(s => !s.StartsWith('~') && !s.StartsWith('!'));
if (prerequisites.Any())
text += $"Requires {prerequisites.JoinWith(", ")}\n\n";
}

View File

@@ -9,7 +9,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Mods.Common.Commands;
@@ -143,7 +142,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var team = teamChat && !disableTeamChat;
if (chatText.Text != "")
{
if (!chatText.Text.StartsWith("/", StringComparison.Ordinal))
if (!chatText.Text.StartsWith('/'))
{
// This should never happen, but avoid a crash if it does somehow (chat will just stay open)
if (!isObserver && orderManager.LocalClient == null && world.LocalPlayer == null)

View File

@@ -98,7 +98,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
var prereqs = buildable.Prerequisites.Select(a => ActorName(mapRules, a))
.Where(s => !s.StartsWith("~", StringComparison.Ordinal) && !s.StartsWith("!", StringComparison.Ordinal));
.Where(s => !s.StartsWith('~') && !s.StartsWith('!'));
var requiresSize = int2.Zero;
if (prereqs.Any())

View File

@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
var toComplete = "";
if (text.StartsWith("/") && Commands != null)
if (text.StartsWith('/') && Commands != null)
{
prefix = "/";
suffix = "";