Skip to content

Commit 5fded62

Browse files
committed
beautify FromNameKey declaration in FromName
1 parent c78a252 commit 5fded62

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyProperty.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -977,16 +977,13 @@ internal static DependencyProperty FromName(string name, Type ownerType)
977977
ArgumentNullException.ThrowIfNull(name);
978978
ArgumentNullException.ThrowIfNull(ownerType);
979979

980-
FromNameKey key;
981-
982980
while ((dp == null) && (ownerType != null))
983981
{
984982
// Ensure static constructor of type has run
985-
MS.Internal.WindowsBase.SecurityHelper.RunClassConstructor(ownerType);
983+
SecurityHelper.RunClassConstructor(ownerType);
986984

987985
// Locate property
988-
key = new FromNameKey(name, ownerType);
989-
986+
FromNameKey key = new(name, ownerType);
990987
lock (Synchronized)
991988
{
992989
if (PropertyFromName.TryGetValue(key, out dp))

0 commit comments

Comments
 (0)