internal static List <CustomAttributeData> GetCustomAttributesImpl(List <CustomAttributeData> list, Module module, int token, Type attributeType)
{
foreach (int i in module.CustomAttribute.Filter(token))
{
if (attributeType == null)
{
if (list == null)
{
list = new List <CustomAttributeData>();
}
list.Add(new CustomAttributeData(module, i));
}
else
{
if (attributeType.IsAssignableFrom(module.ResolveMethod(module.CustomAttribute.records[i].Type).DeclaringType))
{
if (list == null)
{
list = new List <CustomAttributeData>();
}
list.Add(new CustomAttributeData(module, i));
}
}
}
return(list);
}