Skip to content

Commit 0364226

Browse files
committed
Update ReflectionExtensions.cs
1 parent 14a837c commit 0364226

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

src/Paramore.Brighter/Extensions/ReflectionExtensions.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,10 @@ internal static IEnumerable<UnwrapWithAttribute> GetOtherUnwrapsInPipeline(this
5151
}
5252

5353
internal static bool HasNoInboxAttributesInPipeline(this MethodInfo targetMethod)
54-
{
55-
var customAttributes = targetMethod.GetCustomAttributes(true);
56-
return customAttributes
57-
.Any(a => a is NoGlobalInboxAttribute);
58-
}
54+
=> targetMethod.IsDefined(typeof(NoGlobalInboxAttribute), true);
5955

6056
internal static bool HasExistingUseInboxAttributesInPipeline(this MethodInfo targetMethod)
61-
{
62-
var customAttributes = targetMethod.GetCustomAttributes(true);
63-
return customAttributes
64-
.Any(a => a is UseInboxAttribute or UseInboxAsyncAttribute);
65-
}
57+
=> targetMethod.IsDefined(typeof(UseInboxAttribute), true)
58+
|| targetMethod.IsDefined(typeof(UseInboxAsyncAttribute), true);
6659
}
6760
}

0 commit comments

Comments
 (0)