Skip to content

Commit

Permalink
Kill mutant (#1409)
Browse files Browse the repository at this point in the history
  • Loading branch information
martintmk committed Jul 14, 2023
1 parent 54cff7b commit ce83604
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/Polly.Core/Hedging/Controller/HedgingExecutionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,9 @@ private void UpdateOriginalContext()
return;
}

int accepted = 0;
TaskExecution<T>? acceptedExecution = null;
Debug.Assert(Tasks.Count(t => t.IsAccepted) == 1, $"There must be exactly one accepted outcome for hedging. Found {Tasks.Count(t => t.IsAccepted)}.");

foreach (var task in Tasks)
{
if (task.IsAccepted)
{
accepted++;
acceptedExecution = task;
}
}

Debug.Assert(accepted == 1, $"There must be exactly one accepted outcome for hedging. Found {accepted}.");

if (acceptedExecution is not null)
if (Tasks.FirstOrDefault(static t => t.IsAccepted) is TaskExecution<T> acceptedExecution)
{
originalContext.Properties.Replace(acceptedExecution.Properties);

Expand Down

0 comments on commit ce83604

Please sign in to comment.