Skip to content

Commit

Permalink
Fix debug check of codecs names
Browse files Browse the repository at this point in the history
  • Loading branch information
BCSharp authored and slozier committed Dec 13, 2023
1 parent 0be3c1c commit 6a3f6a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Src/IronPython/Runtime/Operations/StringOps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2079,7 +2079,9 @@ internal static partial class CodecsInfo {
#if DEBUG
foreach (KeyValuePair<string, Lazy<Encoding?>> 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);
}
Expand Down

0 comments on commit 6a3f6a0

Please sign in to comment.