Skip to content

Commit

Permalink
Cosmetics on AmqpConnectionScope (#20079)
Browse files Browse the repository at this point in the history
* Deconstruct tuple

* Remove redundant default

* Simplify deconstruction
  • Loading branch information
danielmarbach authored Apr 2, 2021
1 parent 1c306a8 commit ab9962e
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,7 @@ protected virtual async Task OpenAmqpObjectAsync(
// use a static delegate with tuple state to avoid allocating a closure
using var registration = cancellationToken.Register(static state =>
{
var tuple = ((TaskCompletionSource<object>, AmqpObject))state;
TaskCompletionSource<object> tcs = tuple.Item1;
AmqpObject target = tuple.Item2;
var (tcs, target) = ((TaskCompletionSource<object>, AmqpObject)) state;
if (tcs.TrySetCanceled())
{
target.SafeClose();
Expand Down Expand Up @@ -1023,9 +1021,6 @@ static async Task Open(AmqpObject target, TimeSpan timeout, TaskCompletionSource
case RequestResponseAmqpLink linkTarget:
linkTarget.Session?.SafeClose();
break;

default:
break;
}

target.SafeClose();
Expand Down

0 comments on commit ab9962e

Please sign in to comment.