diff --git a/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj b/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj
index 33eb902cddff6..273897b01524a 100644
--- a/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj
+++ b/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj
@@ -66,13 +66,10 @@ The System.Collections.Immutable library is built-in as part of the shared frame
-
-
-
diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/FrozenDictionary.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/FrozenDictionary.cs
index b0fad1cd1115c..3dddb87219090 100644
--- a/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/FrozenDictionary.cs
+++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/FrozenDictionary.cs
@@ -238,9 +238,8 @@ private static FrozenDictionary CreateFromDictionary
}
else
{
- frozenDictionary = analysis.IgnoreCaseForEquals
- ? new OrdinalStringFrozenDictionary_FullCaseSensitiveHashCaseInsensitiveEquals(keys, values, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff)
- : new OrdinalStringFrozenDictionary_Full(keys, values, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff);
+ // if (IgnoreCaseForEquals) => Can only be true if there are no letters, thus case sensitive comparison still works here.
+ frozenDictionary = new OrdinalStringFrozenDictionary_Full(keys, values, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff);
}
}
diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/FrozenSet.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/FrozenSet.cs
index 63c2be5dbec1b..608668351188c 100644
--- a/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/FrozenSet.cs
+++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/FrozenSet.cs
@@ -186,9 +186,8 @@ private static FrozenSet CreateFromSet(HashSet source)
}
else
{
- frozenSet = analysis.IgnoreCaseForEquals
- ? new OrdinalStringFrozenSet_FullCaseSensitiveHashCaseInsensitiveEquals(entries, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff)
- : new OrdinalStringFrozenSet_Full(entries, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff);
+ // if (IgnoreCaseForEquals) => Can only be true if there are no letters, thus case sensitive comparison still works here.
+ frozenSet = new OrdinalStringFrozenSet_Full(entries, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff);
}
}
diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/String/OrdinalStringFrozenDictionary_FullCaseSensitiveHashCaseInsensitiveEquals.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/String/OrdinalStringFrozenDictionary_FullCaseSensitiveHashCaseInsensitiveEquals.cs
deleted file mode 100644
index f3c805e416054..0000000000000
--- a/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/String/OrdinalStringFrozenDictionary_FullCaseSensitiveHashCaseInsensitiveEquals.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Collections.Generic;
-
-namespace System.Collections.Frozen
-{
- internal sealed class OrdinalStringFrozenDictionary_FullCaseSensitiveHashCaseInsensitiveEquals : OrdinalStringFrozenDictionary
- {
- internal OrdinalStringFrozenDictionary_FullCaseSensitiveHashCaseInsensitiveEquals(
- string[] keys,
- TValue[] values,
- IEqualityComparer comparer,
- int minimumLength,
- int maximumLengthDiff)
- : base(keys, values, comparer, minimumLength, maximumLengthDiff)
- {
- }
-
- // This override is necessary to force the jit to emit the code in such a way that it
- // avoids virtual dispatch overhead when calling the Equals/GetHashCode methods. Don't
- // remove this, or you'll tank performance.
- private protected override ref readonly TValue GetValueRefOrNullRefCore(string key) => ref base.GetValueRefOrNullRefCore(key);
-
- private protected override bool Equals(string? x, string? y) => StringComparer.OrdinalIgnoreCase.Equals(x, y);
- private protected override int GetHashCode(string s) => Hashing.GetHashCodeOrdinal(s.AsSpan());
- }
-}
diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/String/OrdinalStringFrozenSet_FullCaseSensitiveHashCaseInsensitiveEquals.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/String/OrdinalStringFrozenSet_FullCaseSensitiveHashCaseInsensitiveEquals.cs
deleted file mode 100644
index ebcd7b14c6b17..0000000000000
--- a/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/String/OrdinalStringFrozenSet_FullCaseSensitiveHashCaseInsensitiveEquals.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Collections.Generic;
-
-namespace System.Collections.Frozen
-{
- internal sealed class OrdinalStringFrozenSet_FullCaseSensitiveHashCaseInsensitiveEquals : OrdinalStringFrozenSet
- {
- internal OrdinalStringFrozenSet_FullCaseSensitiveHashCaseInsensitiveEquals(
- string[] entries,
- IEqualityComparer comparer,
- int minimumLength,
- int maximumLengthDiff)
- : base(entries, comparer, minimumLength, maximumLengthDiff)
- {
- }
-
- // This override is necessary to force the jit to emit the code in such a way that it
- // avoids virtual dispatch overhead when calling the Equals/GetHashCode methods. Don't
- // remove this, or you'll tank performance.
- private protected override int FindItemIndex(string item) => base.FindItemIndex(item);
-
- private protected override bool Equals(string? x, string? y) => StringComparer.OrdinalIgnoreCase.Equals(x, y);
- private protected override int GetHashCode(string s) => Hashing.GetHashCodeOrdinal(s.AsSpan());
- }
-}