Skip to content

Commit

Permalink
Remove redundant string replace
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Pfister committed May 5, 2022
1 parent 5f367d5 commit 28cd339
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/native/libs/System.Globalization.Native/pal_locale.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ int32_t FixupLocaleName(UChar* value, int32_t valueLength)
// The reason is POSIX locale collation behavior is not desirable at all because it doesn't support case insensitive string comparisons.
const char* DetectDefaultLocaleName()
{
const char* icuLocale;

icuLocale = uloc_getDefault();
const char* icuLocale = uloc_getDefault();

if (strcmp(icuLocale, "en_US_POSIX") == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/native/libs/System.Globalization.Native/pal_locale.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}
else
{
localeName = [currentLocale.localeIdentifier stringByReplacingOccurrencesOfString:@"_" withString:@"-"];
localeName = currentLocale.localeIdentifier;
}

return strdup([localeName UTF8String]);
Expand Down

0 comments on commit 28cd339

Please sign in to comment.