diff --git a/.editorconfig b/.editorconfig index 3bc5a4395e..7fc0d48e29 100644 --- a/.editorconfig +++ b/.editorconfig @@ -153,6 +153,9 @@ dotnet_diagnostic.IDE1006.severity = warning # Avoid unnecessary zero-length array allocations. dotnet_diagnostic.CA1825.severity = warning +# Do not use Enumerable methods on indexable collections. Instead use the collection directly. +dotnet_diagnostic.CA1826.severity = warning + # Use string.Contains(char) instead of string.Contains(string) with single characters. dotnet_diagnostic.CA1847.severity = warning diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs index e61003b164..0ab17b24be 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs @@ -76,7 +76,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (player.HasObjectives) { var mo = player.PlayerActor.Trait(); - checkbox.GetText = () => mo.Objectives.First().Description; + checkbox.GetText = () => mo.Objectives[0].Description; } statusLabel.GetText = () => player.WinState == WinState.Won ? Accomplished :