Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 01f247d

Browse files
tuespetreTratcher
authored andcommitted
Prevent an unnecessary allocation of a state machine (thanks @PinpointTownes)
1 parent 59b605c commit 01f247d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Microsoft.AspNetCore.Http.Abstractions/Extensions/UseWhenExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public static IApplicationBuilder UseWhen(this IApplicationBuilder app, Predicat
5050
branchBuilder.Run(main);
5151
var branch = branchBuilder.Build();
5252

53-
return async context =>
53+
return context =>
5454
{
5555
if (predicate(context))
5656
{
57-
await branch(context);
57+
return branch(context);
5858
}
5959
else
6060
{
61-
await main(context);
61+
return main(context);
6262
}
6363
};
6464
});

0 commit comments

Comments
 (0)