Use Attribute.IsDefined over GetCustomAttributes

This commit is contained in:
abcdefg30
2022-08-12 17:50:08 +02:00
committed by Matthias Mailänder
parent aa14c9c570
commit f49536ea12

View File

@@ -53,7 +53,7 @@ namespace OpenRA
public static bool HasAttribute<T>(this MemberInfo mi)
{
return mi.GetCustomAttributes(typeof(T), true).Length != 0;
return Attribute.IsDefined(mi, typeof(T));
}
public static T[] GetCustomAttributes<T>(this MemberInfo mi, bool inherit)