Skip to content

Commit 995d024

Browse files
committed
Remove redundant static fields to reduce memory usage
1 parent 0be453c commit 995d024

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Schema/XamlTypeInvoker.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ namespace System.Xaml.Schema
1717
public class XamlTypeInvoker
1818
{
1919
private static XamlTypeInvoker s_Unknown;
20-
private static object[] s_emptyObjectArray = Array.Empty<object>();
2120

2221
private Dictionary<XamlType, MethodInfo> _addMethods;
2322
internal MethodInfo EnumeratorMethod { get; set; }
@@ -223,7 +222,7 @@ public virtual IEnumerator GetItems(object instance)
223222
throw new NotSupportedException(SR.OnlySupportedOnCollectionsAndDictionaries);
224223
}
225224
MethodInfo getEnumMethod = GetEnumeratorMethod();
226-
return (IEnumerator)getEnumMethod.Invoke(instance, s_emptyObjectArray);
225+
return (IEnumerator)getEnumMethod.Invoke(instance, Array.Empty<object>());
227226
}
228227

229228
// vvvvv---- Unused members. Servicing policy is to retain these anyway. -----vvvvv

0 commit comments

Comments
 (0)