Prevent an unnecessary allocation of a state machine (thanks @PinpointTownes)

This commit is contained in:
Derek Gray 2016-07-05 15:26:10 -05:00 committed by Chris R
parent 59b605cafb
commit 01f247db48
1 changed files with 3 additions and 3 deletions

View File

@ -50,15 +50,15 @@ namespace Microsoft.AspNetCore.Builder
branchBuilder.Run(main);
var branch = branchBuilder.Build();
return async context =>
return context =>
{
if (predicate(context))
{
await branch(context);
return branch(context);
}
else
{
await main(context);
return main(context);
}
};
});