Avoid an unnecessary closure allocation in ListenerSecondary (#1485)

The tcs is being passed as the state, so use it from the state instead
of closing over it.
This commit is contained in:
Justin Van Patten 2017-03-12 12:20:41 -07:00 committed by David Fowler
parent a26f96237b
commit b612da4e6c
1 changed files with 3 additions and 2 deletions

View File

@ -109,13 +109,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
{ {
req.Dispose(); req.Dispose();
var innerTcs = (TaskCompletionSource<int>)state;
if (ex != null) if (ex != null)
{ {
tcs.SetException(ex); innerTcs.SetException(ex);
} }
else else
{ {
tcs.SetResult(0); innerTcs.SetResult(0);
} }
}, },
tcs); tcs);