diff --git a/.editorconfig b/.editorconfig index ae2fa49652..d53ca2d35e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -741,6 +741,9 @@ dotnet_diagnostic.CA1839.severity = warning # Use Environment.CurrentManagedThreadId instead of Thread.CurrentThread.ManagedThreadId. dotnet_diagnostic.CA1840.severity = warning +# Prefer Dictionary Contains methods. +dotnet_diagnostic.CA1841.severity = warning + # Do not use 'WhenAll' with a single task. dotnet_diagnostic.CA1842.severity = warning diff --git a/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs b/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs index b2ed921e38..bf4f2f8e9d 100644 --- a/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs @@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Lint if (string.IsNullOrEmpty(voice)) continue; - if (!soundInfo.Voices.Keys.Contains(voice)) + if (!soundInfo.Voices.ContainsKey(voice)) emitError($"Actor {actorInfo.Name} using voice set {voiceSet} does not define {voice} voice required by {traitInfo}."); } }