summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2018-06-07 13:24:11 -0400
committerJan Kotas <jkotas@microsoft.com>2018-06-07 10:24:11 -0700
commit33910ce097e4812d17edad61c88c9c348ed80fa8 (patch)
tree09a6f4d06d4cca195bbc232e7796b782631e5cb2 /src
parent21c0aeb5e84cfb55c98fb447fbecb0d8c4f1ea22 (diff)
downloadcoreclr-33910ce097e4812d17edad61c88c9c348ed80fa8.tar.gz
coreclr-33910ce097e4812d17edad61c88c9c348ed80fa8.tar.bz2
coreclr-33910ce097e4812d17edad61c88c9c348ed80fa8.zip
Remove dead case from string.Compare (#18345)
Diffstat (limited to 'src')
-rw-r--r--src/System.Private.CoreLib/shared/System/String.Comparison.cs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/System.Private.CoreLib/shared/System/String.Comparison.cs b/src/System.Private.CoreLib/shared/System/String.Comparison.cs
index 99efcbe5aa..3ddc90a502 100644
--- a/src/System.Private.CoreLib/shared/System/String.Comparison.cs
+++ b/src/System.Private.CoreLib/shared/System/String.Comparison.cs
@@ -415,11 +415,9 @@ namespace System
case StringComparison.Ordinal:
return CompareOrdinalHelper(strA, indexA, lengthA, strB, indexB, lengthB);
- case StringComparison.OrdinalIgnoreCase:
- return CompareInfo.CompareOrdinalIgnoreCase(strA, indexA, lengthA, strB, indexB, lengthB);
-
default:
- throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType));
+ Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); // CheckStringComparison validated these earlier
+ return CompareInfo.CompareOrdinalIgnoreCase(strA, indexA, lengthA, strB, indexB, lengthB);
}
}