Fix RCS1080

This commit is contained in:
RoosterDragon
2023-03-18 12:48:59 +00:00
committed by Gustas
parent 06aa378dfd
commit ce39e97b86
3 changed files with 5 additions and 3 deletions

View File

@@ -995,6 +995,9 @@ dotnet_diagnostic.RCS1072.severity = warning
# Remove redundant constructor. # Remove redundant constructor.
dotnet_diagnostic.RCS1074.severity = warning dotnet_diagnostic.RCS1074.severity = warning
# Use 'Count' property instead of 'Any' method.
dotnet_diagnostic.RCS1080.severity = warning
# Remove empty region. # Remove empty region.
dotnet_diagnostic.RCS1091.severity = warning dotnet_diagnostic.RCS1091.severity = warning

View File

@@ -38,7 +38,7 @@ namespace OpenRA.UtilityCommands
.ToDictionary( .ToDictionary(
t => t.Name[..^6], t => t.Name[..^6],
t => t.GetFields().Where(f => f.HasAttribute<TranslationReferenceAttribute>()).Select(f => f.Name).ToArray()) t => t.GetFields().Where(f => f.HasAttribute<TranslationReferenceAttribute>()).Select(f => f.Name).ToArray())
.Where(t => t.Value.Any()) .Where(t => t.Value.Length > 0)
.ToDictionary(t => t.Key, t => t.Value); .ToDictionary(t => t.Key, t => t.Value);
var chromeLayouts = modData.Manifest.ChromeLayout.GroupBy(c => c.Split('/')[0].Split('|')[0], c => c); var chromeLayouts = modData.Manifest.ChromeLayout.GroupBy(c => c.Split('/')[0].Split('|')[0], c => c);

View File

@@ -10,7 +10,6 @@
#endregion #endregion
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace OpenRA.Mods.Common.UpdateRules.Rules namespace OpenRA.Mods.Common.UpdateRules.Rules
{ {
@@ -24,7 +23,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
public override IEnumerable<string> AfterUpdate(ModData modData) public override IEnumerable<string> AfterUpdate(ModData modData)
{ {
if (locations.Any()) if (locations.Count > 0)
yield return Description + "\n" + yield return Description + "\n" +
"ValidRelations have been removed from:\n" + "ValidRelations have been removed from:\n" +
UpdateUtils.FormatMessageList(locations); UpdateUtils.FormatMessageList(locations);