diff options
author | Justin Van Patten <jvp@justinvp.com> | 2016-06-11 06:07:56 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-06-11 06:07:56 -0700 |
commit | 59e0c0e5ac45986e8345043f53198f16a44191b4 (patch) | |
tree | 5957fa74d191107afbb593b3d501d1d227916f8f | |
parent | 0c7ac3bc7cf532ce4d6dd75909439bd69f871de8 (diff) | |
download | coreclr-59e0c0e5ac45986e8345043f53198f16a44191b4.tar.gz coreclr-59e0c0e5ac45986e8345043f53198f16a44191b4.tar.bz2 coreclr-59e0c0e5ac45986e8345043f53198f16a44191b4.zip |
JapaneseCalendar: Use Registry.LocalMachine instead of RegistryKey.GetBaseKey(RegistryKey.HKEY_LOCAL_MACHINE) (#5725)
JapaneseCalendar is the only code outside of the Registry code that
calls RegistryKey.GetBaseKey(RegistryKey.HKEY_LOCAL_MACHINE) to get a
RegistryKey instance for the local machine hive. Everywhere else uses
Registry.LocalMachine. Update JapaneseCalendar to match, which also
avoids the unnecessary RegistryKey/SafeRegistryHandle allocations.
-rw-r--r-- | src/mscorlib/src/System/Globalization/JapaneseCalendar.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mscorlib/src/System/Globalization/JapaneseCalendar.cs b/src/mscorlib/src/System/Globalization/JapaneseCalendar.cs index 801b2e1664..2984d08ab3 100644 --- a/src/mscorlib/src/System/Globalization/JapaneseCalendar.cs +++ b/src/mscorlib/src/System/Globalization/JapaneseCalendar.cs @@ -172,7 +172,7 @@ namespace System.Globalization { PermissionSet permSet = new PermissionSet(PermissionState.None); permSet.AddPermission(new RegistryPermission(RegistryPermissionAccess.Read, c_japaneseErasHivePermissionList)); permSet.Assert(); - RegistryKey key = RegistryKey.GetBaseKey(RegistryKey.HKEY_LOCAL_MACHINE).OpenSubKey(c_japaneseErasHive, false); + RegistryKey key = Registry.LocalMachine.OpenSubKey(c_japaneseErasHive, writable: false); // Abort if we didn't find anything if (key == null) return null; |