This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/System.Private.CoreLib/shared/System/Globalization Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1142,9 +1142,10 @@ internal bool HasInvariantCultureName
1142
1142
{
1143
1143
Debug . Assert ( name != null && ( lcid != - 1 || altName != null ) ) ;
1144
1144
bool ret ;
1145
+ string key = lcid == 0 ? name ! : name ! + '\xfffd ' + altName ! ;
1145
1146
lock ( _lock )
1146
1147
{
1147
- ret = tempNameHT . TryGetValue ( lcid == 0 ? name ! : name ! + ' \xfffd ' + altName ! , out retval ) ;
1148
+ ret = tempNameHT . TryGetValue ( key , out retval ) ;
1148
1149
}
1149
1150
1150
1151
if ( ret && retval != null )
@@ -1211,10 +1212,11 @@ internal bool HasInvariantCultureName
1211
1212
1212
1213
if ( lcid == - 1 )
1213
1214
{
1215
+ string key = name + '\xfffd ' + altName ;
1214
1216
lock ( _lock )
1215
1217
{
1216
1218
// This new culture will be added only to the name hash table.
1217
- tempNameHT [ name + ' \xfffd ' + altName ] = retval ;
1219
+ tempNameHT [ key ] = retval ;
1218
1220
}
1219
1221
// when lcid == -1 then TextInfo object is already get created and we need to set it as read only.
1220
1222
retval . TextInfo . SetReadOnlyState ( true ) ;
You can’t perform that action at this time.
0 commit comments