Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 52da166

Browse files
committed
Fix GetHashCode with invariant mode
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
1 parent 8fd7c72 commit 52da166

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Common/src/CoreLib/System/Globalization/CompareInfo.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,11 @@ internal int GetHashCodeOfString(string source, CompareOptions options)
12571257
throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options));
12581258
}
12591259

1260+
if (_invariantMode)
1261+
{
1262+
return ((options & CompareOptions.IgnoreCase) != 0) ? TextInfo.GetHashCodeOrdinalIgnoreCase(source) : source.GetHashCode();
1263+
}
1264+
12601265
return GetHashCodeOfStringCore(source, options);
12611266
}
12621267

0 commit comments

Comments
 (0)