Fix IDE0057
This commit is contained in:
committed by
Pavel Penev
parent
5254348819
commit
023d80b94d
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
var checkWidgetFields = modData.ObjectCreator.GetTypesImplementing<Widget>()
|
||||
.SelectMany(w => Utility.GetFields(w)
|
||||
.Where(f => f.FieldType == typeof(HotkeyReference))
|
||||
.Select(f => (w.Name.Substring(0, w.Name.Length - 6), f.Name)))
|
||||
.Select(f => (w.Name[..^6], f.Name)))
|
||||
.ToArray();
|
||||
|
||||
var customLintMethods = new Dictionary<string, List<string>>();
|
||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
var p = m.GetParameters();
|
||||
if (p.Length == 3 && p[0].ParameterType == typeof(MiniYamlNode) && p[1].ParameterType == typeof(Action<string>)
|
||||
&& p[2].ParameterType == typeof(Action<string>))
|
||||
customLintMethods.GetOrAdd(w.Name.Substring(0, w.Name.Length - 6)).Add(m.Name);
|
||||
customLintMethods.GetOrAdd(w.Name[..^6]).Add(m.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
{
|
||||
var name = key.Split('@')[0];
|
||||
if (name.StartsWith("-", StringComparison.Ordinal))
|
||||
return name.Substring(1);
|
||||
return name[1..];
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
{
|
||||
var name = key.Split('@')[0];
|
||||
if (name.StartsWith("-", StringComparison.Ordinal))
|
||||
return name.Substring(1);
|
||||
return name[1..];
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user