diff options
author | Ryan Lucia <rylucia@microsoft.com> | 2020-01-02 19:58:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-02 19:58:15 +0300 |
commit | ff6294d2311932902a9e790bbcc79f109a602d0c (patch) | |
tree | ab2921c86893b0d3955c7eba61f86579e85bb4b1 /mcs | |
parent | 675f1eb32141fb0904b1499382ccca4b38c1e46a (diff) |
[reflection] Convert internal GetCustomAttributes calls to Attribute[] (#18176)
* [reflection] Avoid creating object[] in GetCustomAttributesBase
* [reflection] Migrate Attribute type checking to CustomAttribute.cs
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/corlib/System/MonoCustomAttrs.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mcs/class/corlib/System/MonoCustomAttrs.cs b/mcs/class/corlib/System/MonoCustomAttrs.cs index b79760fef35..5761df5fa63 100644 --- a/mcs/class/corlib/System/MonoCustomAttrs.cs +++ b/mcs/class/corlib/System/MonoCustomAttrs.cs @@ -67,7 +67,7 @@ namespace System } [MethodImplAttribute (MethodImplOptions.InternalCall)] - internal static extern object[] GetCustomAttributesInternal (ICustomAttributeProvider obj, Type attributeType, bool pseudoAttrs); + internal static extern Attribute[] GetCustomAttributesInternal (ICustomAttributeProvider obj, Type attributeType, bool pseudoAttrs); internal static object[] GetPseudoCustomAttributes (ICustomAttributeProvider obj, Type attributeType) { object[] pseudoAttrs = null; @@ -134,7 +134,7 @@ namespace System if (!inheritedOnly) { object[] pseudoAttrs = GetPseudoCustomAttributes (obj, attributeType); if (pseudoAttrs != null) { - object[] res = new object [attrs.Length + pseudoAttrs.Length]; + object[] res = new Attribute [attrs.Length + pseudoAttrs.Length]; System.Array.Copy (attrs, res, attrs.Length); System.Array.Copy (pseudoAttrs, 0, res, attrs.Length, pseudoAttrs.Length); return res; |