From 6a3f6a0093a6a475180d4ebb7eb480b07de0819d Mon Sep 17 00:00:00 2001 From: Pavel Koneski Date: Tue, 12 Dec 2023 18:38:28 -0800 Subject: [PATCH] Fix debug check of codecs names --- Src/IronPython/Runtime/Operations/StringOps.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Src/IronPython/Runtime/Operations/StringOps.cs b/Src/IronPython/Runtime/Operations/StringOps.cs index ca1cf3896..9a3e98a7c 100644 --- a/Src/IronPython/Runtime/Operations/StringOps.cs +++ b/Src/IronPython/Runtime/Operations/StringOps.cs @@ -2079,7 +2079,9 @@ internal static partial class CodecsInfo { #if DEBUG foreach (KeyValuePair> kvp in d) { // all codecs should be stored in lowercase because we only look up from lowercase strings - Debug.Assert(kvp.Key.Equals(kvp.Key, StringComparison.OrdinalIgnoreCase)); + #pragma warning disable CA1862 // disable warning about comparing with ToLower() + Debug.Assert(kvp.Key.ToLower(CultureInfo.InvariantCulture) == kvp.Key); + #pragma warning restore // all codec names should use underscores instead of dashes to match lookup values Debug.Assert(kvp.Key.IndexOf('-') < 0); }