summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Reflection/CustomAttribute.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Reflection/CustomAttribute.cs')
-rw-r--r--src/mscorlib/src/System/Reflection/CustomAttribute.cs31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/mscorlib/src/System/Reflection/CustomAttribute.cs b/src/mscorlib/src/System/Reflection/CustomAttribute.cs
index 96eb45f3e4..1cf00f17d8 100644
--- a/src/mscorlib/src/System/Reflection/CustomAttribute.cs
+++ b/src/mscorlib/src/System/Reflection/CustomAttribute.cs
@@ -20,7 +20,6 @@ using System.Diagnostics.Contracts;
namespace System.Reflection
{
- [Serializable]
public class CustomAttributeData
{
#region Public Static Members
@@ -570,7 +569,6 @@ namespace System.Reflection
#endregion
}
- [Serializable]
public struct CustomAttributeNamedArgument
{
#region Public Static Members
@@ -659,7 +657,6 @@ namespace System.Reflection
}
- [Serializable]
public struct CustomAttributeTypedArgument
{
#region Public Static Members
@@ -958,14 +955,12 @@ namespace System.Reflection
#endregion
}
- [Serializable]
internal struct CustomAttributeRecord
{
internal ConstArray blob;
internal MetadataToken tkCtor;
}
- [Serializable]
internal enum CustomAttributeEncoding : int
{
Undefined = 0,
@@ -990,7 +985,6 @@ namespace System.Reflection
Enum = 0x55
}
- [Serializable]
[StructLayout(LayoutKind.Auto)]
internal struct CustomAttributeEncodedArgument
{
@@ -1045,7 +1039,6 @@ namespace System.Reflection
#endregion
}
- [Serializable]
[StructLayout(LayoutKind.Auto)]
internal struct CustomAttributeNamedParameter
{
@@ -1077,7 +1070,6 @@ namespace System.Reflection
#endregion
}
- [Serializable]
[StructLayout(LayoutKind.Auto)]
internal struct CustomAttributeCtorParameter
{
@@ -1099,7 +1091,6 @@ namespace System.Reflection
#endregion
}
- [Serializable]
[StructLayout(LayoutKind.Auto)]
internal struct CustomAttributeType
{
@@ -2040,7 +2031,7 @@ namespace System.Reflection
count = 0;
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null && !IsSecurityAttribute(caType))
+ if (!all && !s_pca.ContainsKey(caType) && !IsSecurityAttribute(caType))
return Array.Empty<Attribute>();
List<Attribute> pcas = new List<Attribute>();
@@ -2078,7 +2069,7 @@ namespace System.Reflection
internal static bool IsDefined(RuntimeType type, RuntimeType caType)
{
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null && !IsSecurityAttribute(caType))
+ if (!all && !s_pca.ContainsKey(caType) && !IsSecurityAttribute(caType))
return false;
if (all || caType == (RuntimeType)typeof(SerializableAttribute))
@@ -2107,7 +2098,7 @@ namespace System.Reflection
count = 0;
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null && !IsSecurityAttribute(caType))
+ if (!all && !s_pca.ContainsKey(caType) && !IsSecurityAttribute(caType))
return Array.Empty<Attribute>();
List<Attribute> pcas = new List<Attribute>();
@@ -2140,7 +2131,7 @@ namespace System.Reflection
internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType caType)
{
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return false;
if (all || caType == (RuntimeType)typeof(DllImportAttribute))
@@ -2170,7 +2161,7 @@ namespace System.Reflection
count = 0;
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return null;
Attribute[] pcas = new Attribute[s_pcasCount];
@@ -2201,7 +2192,7 @@ namespace System.Reflection
internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType)
{
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return false;
@@ -2231,7 +2222,7 @@ namespace System.Reflection
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null && !IsSecurityAttribute(caType))
+ if (!all && !s_pca.ContainsKey(caType) && !IsSecurityAttribute(caType))
return Array.Empty<Attribute>();
List<Attribute> pcas = new List<Attribute>();
@@ -2283,7 +2274,7 @@ namespace System.Reflection
count = 0;
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return null;
Attribute[] pcas = new Attribute[s_pcasCount];
@@ -2309,7 +2300,7 @@ namespace System.Reflection
internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
{
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return false;
if (all || caType == (RuntimeType)typeof(MarshalAsAttribute))
@@ -2334,7 +2325,7 @@ namespace System.Reflection
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null && !IsSecurityAttribute(caType))
+ if (!all && !s_pca.ContainsKey(caType) && !IsSecurityAttribute(caType))
return Array.Empty<Attribute>();
List<Attribute> pcas = new List<Attribute>();
@@ -2357,7 +2348,7 @@ namespace System.Reflection
{
bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
- if (!all && s_pca.GetValueOrDefault(caType) == null)
+ if (!all && !s_pca.ContainsKey(caType))
return false;
if (all || IsSecurityAttribute(caType))