Fix IDE0062

This commit is contained in:
RoosterDragon
2023-04-05 19:13:22 +01:00
committed by Pavel Penev
parent 023d80b94d
commit cbd0583289
5 changed files with 6 additions and 6 deletions

View File

@@ -63,7 +63,7 @@ dotnet_diagnostic.IDE0044.severity = warning
# IDE0062 Make local function static # IDE0062 Make local function static
#csharp_prefer_static_local_function = true #csharp_prefer_static_local_function = true
dotnet_diagnostic.IDE0062.severity = silent # Requires C# 8 - TODO Consider enabling dotnet_diagnostic.IDE0062.severity = warning
# IDE0064 Make struct fields writable # IDE0064 Make struct fields writable
# No options # No options

View File

@@ -118,7 +118,7 @@ namespace OpenRA
var unresolved = source.ToHashSet(); var unresolved = source.ToHashSet();
unresolved.ExceptWith(resolved); unresolved.ExceptWith(resolved);
bool AreResolvable(Type a, Type b) => a.IsAssignableFrom(b); static bool AreResolvable(Type a, Type b) => a.IsAssignableFrom(b);
// This query detects which unresolved traits can be immediately resolved as all their direct dependencies are met. // This query detects which unresolved traits can be immediately resolved as all their direct dependencies are met.
var more = unresolved.Where(u => var more = unresolved.Where(u =>

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Cnc.Traits
public void LoadPalettes(WorldRenderer wr) public void LoadPalettes(WorldRenderer wr)
{ {
uint MakeColor(int i) static uint MakeColor(int i)
{ {
if (i < 128) if (i < 128)
return (uint)(int2.Lerp(255, 0, i, 127) << 24); return (uint)(int2.Lerp(255, 0, i, 127) << 24);

View File

@@ -307,7 +307,7 @@ namespace OpenRA.Mods.Common.Pathfinder
/// </summary> /// </summary>
void BuildGrids() void BuildGrids()
{ {
Grid GetCPosBounds(Map map) static Grid GetCPosBounds(Map map)
{ {
if (map.Grid.Type == MapGridType.RectangularIsometric) if (map.Grid.Type == MapGridType.RectangularIsometric)
{ {
@@ -369,7 +369,7 @@ namespace OpenRA.Mods.Common.Pathfinder
} }
} }
CPos AbstractCellForLocalCells(List<CPos> cells, byte layer) static CPos AbstractCellForLocalCells(List<CPos> cells, byte layer)
{ {
var minX = int.MaxValue; var minX = int.MaxValue;
var minY = int.MaxValue; var minY = int.MaxValue;

View File

@@ -692,7 +692,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
header.Get<LabelWidget>("LABEL").GetText = () => headerTitle; header.Get<LabelWidget>("LABEL").GetText = () => headerTitle;
rows.Add(header); rows.Add(header);
int ListOrder(GameServer g) static int ListOrder(GameServer g)
{ {
// Servers waiting for players are always first // Servers waiting for players are always first
if (g.State == (int)ServerState.WaitingPlayers && g.Players > 0) if (g.State == (int)ServerState.WaitingPlayers && g.Players > 0)