Skip to content

Commit

Permalink
Avoid boxing array enumerator in StackTrace.TryResolveStateMachineMet…
Browse files Browse the repository at this point in the history
…hod (dotnet#66836)
  • Loading branch information
stephentoub authored and radekdoulik committed Mar 30, 2022
1 parent eb4f90c commit 9720afa
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ private static bool TryResolveStateMachineMethod(ref MethodBase method, out Type

foreach (MethodInfo candidateMethod in methods)
{
IEnumerable<StateMachineAttribute>? attributes = candidateMethod.GetCustomAttributes<StateMachineAttribute>(inherit: false);
StateMachineAttribute[]? attributes = (StateMachineAttribute[])Attribute.GetCustomAttributes(candidateMethod, typeof(StateMachineAttribute), inherit: false);
if (attributes == null)
{
continue;
Expand Down

0 comments on commit 9720afa

Please sign in to comment.