Use Attribute.IsDefined over GetCustomAttributes
This commit is contained in:
committed by
Matthias Mailänder
parent
aa14c9c570
commit
f49536ea12
@@ -53,7 +53,7 @@ namespace OpenRA
|
|||||||
|
|
||||||
public static bool HasAttribute<T>(this MemberInfo mi)
|
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)
|
public static T[] GetCustomAttributes<T>(this MemberInfo mi, bool inherit)
|
||||||
|
|||||||
Reference in New Issue
Block a user