From f49536ea12fff638a07c088440cd2a40d4bfd75d Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Fri, 12 Aug 2022 17:50:08 +0200 Subject: [PATCH] Use Attribute.IsDefined over GetCustomAttributes --- OpenRA.Game/Exts.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Exts.cs b/OpenRA.Game/Exts.cs index 27d9d18d21..3d4af5be77 100644 --- a/OpenRA.Game/Exts.cs +++ b/OpenRA.Game/Exts.cs @@ -53,7 +53,7 @@ namespace OpenRA public static bool HasAttribute(this MemberInfo mi) { - return mi.GetCustomAttributes(typeof(T), true).Length != 0; + return Attribute.IsDefined(mi, typeof(T)); } public static T[] GetCustomAttributes(this MemberInfo mi, bool inherit)