summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTarek Mahmoud Sayed <tarekms@microsoft.com>2018-03-13 16:44:31 -0700
committerTarek Mahmoud Sayed <tarekms@microsoft.com>2018-03-13 18:52:06 -0700
commit449a6d515a5ae7c870dc87ba5788067e42b875bc (patch)
tree0a75441ae8725743cf8a933decb92b12670dd258
parent578818a29935ef483b7d366b4591d51c22f5e8bd (diff)
downloadcoreclr-449a6d515a5ae7c870dc87ba5788067e42b875bc.tar.gz
coreclr-449a6d515a5ae7c870dc87ba5788067e42b875bc.tar.bz2
coreclr-449a6d515a5ae7c870dc87ba5788067e42b875bc.zip
Fix GetHashCode with invariant mode
-rw-r--r--src/mscorlib/shared/System/Globalization/CompareInfo.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mscorlib/shared/System/Globalization/CompareInfo.cs b/src/mscorlib/shared/System/Globalization/CompareInfo.cs
index a288f3657f..ef76c7c75c 100644
--- a/src/mscorlib/shared/System/Globalization/CompareInfo.cs
+++ b/src/mscorlib/shared/System/Globalization/CompareInfo.cs
@@ -1257,6 +1257,11 @@ namespace System.Globalization
throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options));
}
+ if (_invariantMode)
+ {
+ return ((options & CompareOptions.IgnoreCase) != 0) ? TextInfo.GetHashCodeOrdinalIgnoreCase(source) : source.GetHashCode();
+ }
+
return GetHashCodeOfStringCore(source, options);
}