Skip to content

Commit beb06f6

Browse files
Potential fix for pull request finding 'Missed opportunity to use Where'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent da2d895 commit beb06f6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Client/Grpc/ProtoUtils.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
using System.Collections.Immutable;
5+
using System.Linq;
56
using P = Microsoft.DurableTask.Protobuf;
67

78
namespace Microsoft.DurableTask.Client.Grpc;
@@ -47,12 +48,9 @@ public static class ProtoUtils
4748
P.OrchestrationIdReusePolicy policy = new();
4849

4950
// Add terminal statuses that are NOT in dedupeStatuses as replaceable
50-
foreach (P.OrchestrationStatus terminalStatus in terminalStatuses)
51+
foreach (P.OrchestrationStatus terminalStatus in terminalStatuses.Where(status => !dedupeStatusSet.Contains(status)))
5152
{
52-
if (!dedupeStatusSet.Contains(terminalStatus))
53-
{
54-
policy.ReplaceableStatus.Add(terminalStatus);
55-
}
53+
policy.ReplaceableStatus.Add(terminalStatus);
5654
}
5755

5856
// Only return policy if we have replaceable statuses

0 commit comments

Comments
 (0)