From: Ilya Date: Tue, 2 Jul 2019 12:54:03 +0000 (+0500) Subject: Reduce allocations in GetLocale() (dotnet/coreclr#25531) X-Git-Tag: submit/tizen/20210909.063632~11030^2~1053 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37a7407886f51be926fd251f499e79d7d2b86894;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Reduce allocations in GetLocale() (dotnet/coreclr#25531) Commit migrated from https://github.com/dotnet/coreclr/commit/db90a795f5280ead19d5cc1780e9e25aad29fb8d --- diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs index 8c60a92..92cd2b8 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs @@ -545,7 +545,7 @@ namespace System.Reflection if (locale == null) return CultureInfo.InvariantCulture; - return new CultureInfo(locale); + return CultureInfo.GetCultureInfo(locale); } [MethodImplAttribute(MethodImplOptions.InternalCall)]