Skip to content

Commit

Permalink
Remove redundant static fields to reduce memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Dec 25, 2023
1 parent ee9c6d0 commit 19bb64a
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace System.Xaml.Schema
public class XamlTypeInvoker
{
private static XamlTypeInvoker s_Unknown;
private static object[] s_emptyObjectArray = Array.Empty<object>();

private Dictionary<XamlType, MethodInfo> _addMethods;
internal MethodInfo EnumeratorMethod { get; set; }
Expand Down Expand Up @@ -226,7 +225,7 @@ public virtual IEnumerator GetItems(object instance)
throw new NotSupportedException(SR.Get(SRID.OnlySupportedOnCollectionsAndDictionaries));
}
MethodInfo getEnumMethod = GetEnumeratorMethod();
return (IEnumerator)SafeReflectionInvoker.InvokeMethod(getEnumMethod, instance, s_emptyObjectArray);
return (IEnumerator)SafeReflectionInvoker.InvokeMethod(getEnumMethod, instance, Array.Empty<object>());
}

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

0 comments on commit 19bb64a

Please sign in to comment.