From b917ac001c9926af036d6424d41c25aada47945a Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Thu, 8 Dec 2016 16:44:20 -0800 Subject: [PATCH] TimeZoneInfo: Use string.Concat instead of string.Format (dotnet/coreclr#8540) It's more efficient to concatenate the strings. Commit migrated from https://github.com/dotnet/coreclr/commit/2d56f76c0a7a44e194104e54e5e9c66feba3e931 --- src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs b/src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs index 7d26f83..7758b4e 100644 --- a/src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs +++ b/src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs @@ -2971,8 +2971,7 @@ namespace System { try { using (RegistryKey dynamicKey = Registry.LocalMachine.OpenSubKey( - String.Format(CultureInfo.InvariantCulture, "{0}\\{1}\\Dynamic DST", - c_timeZonesRegistryHive, id), + c_timeZonesRegistryHive + "\\" + id + "\\Dynamic DST", #if FEATURE_MACL RegistryKeyPermissionCheck.Default, System.Security.AccessControl.RegistryRights.ReadKey @@ -3141,8 +3140,7 @@ namespace System { permSet.Assert(); using (RegistryKey key = Registry.LocalMachine.OpenSubKey( - String.Format(CultureInfo.InvariantCulture, "{0}\\{1}", - c_timeZonesRegistryHive, id), + c_timeZonesRegistryHive + "\\" + id, #if FEATURE_MACL RegistryKeyPermissionCheck.Default, System.Security.AccessControl.RegistryRights.ReadKey @@ -3411,8 +3409,7 @@ namespace System { permSet.Assert(); using (RegistryKey key = Registry.LocalMachine.OpenSubKey( - String.Format(CultureInfo.InvariantCulture, "{0}\\{1}", - c_timeZonesRegistryHive, id), + c_timeZonesRegistryHive + "\\" + id, #if FEATURE_MACL RegistryKeyPermissionCheck.Default, System.Security.AccessControl.RegistryRights.ReadKey -- 2.7.4