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:
parent
a26f96237b
commit
b612da4e6c
|
|
@ -109,13 +109,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
|||
{
|
||||
req.Dispose();
|
||||
|
||||
var innerTcs = (TaskCompletionSource<int>)state;
|
||||
if (ex != null)
|
||||
{
|
||||
tcs.SetException(ex);
|
||||
innerTcs.SetException(ex);
|
||||
}
|
||||
else
|
||||
{
|
||||
tcs.SetResult(0);
|
||||
innerTcs.SetResult(0);
|
||||
}
|
||||
},
|
||||
tcs);
|
||||
|
|
|
|||
Loading…
Reference in New Issue