Revert #if NET6_0_OR_GREATER back to #if NET; inline executorIndex++

Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/c5655707-5b0b-44f3-98a9-5f3961e32cfe

Co-authored-by: lokitoth <6936551+lokitoth@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-14 12:58:08 +00:00
committed by GitHub
Unverified
parent f94ed16bc8
commit a43e6d993e
2 changed files with 4 additions and 6 deletions
@@ -40,8 +40,7 @@ public sealed class SwitchBuilder
foreach (ExecutorBinding executor in executors)
{
Throw.IfNull(executor, $"{nameof(executors)}[{executorIndex}]");
executorIndex++;
Throw.IfNull(executor, $"{nameof(executors)}[{executorIndex++}]");
if (!this._executorIndicies.TryGetValue(executor.Id, out int index))
{
@@ -72,8 +71,7 @@ public sealed class SwitchBuilder
foreach (ExecutorBinding executor in executors)
{
Throw.IfNull(executor, $"{nameof(executors)}[{executorIndex}]");
executorIndex++;
Throw.IfNull(executor, $"{nameof(executors)}[{executorIndex++}]");
if (!this._executorIndicies.TryGetValue(executor.Id, out int index))
{
@@ -62,7 +62,7 @@ public static class WorkflowBuilderExtensions
Func<object?, bool> predicate = WorkflowBuilder.CreateConditionFunc<TMessage>(IsAllowedTypeAndMatchingCondition)!;
#if NET6_0_OR_GREATER
#if NET
if (targets.TryGetNonEnumeratedCount(out int count) && count == 1)
#else
if (targets is ICollection<ExecutorBinding> { Count: 1 })
@@ -111,7 +111,7 @@ public static class WorkflowBuilderExtensions
Func<object?, bool> predicate = WorkflowBuilder.CreateConditionFunc<TMessage>((Func<object?, bool>)IsAllowedType)!;
#if NET6_0_OR_GREATER
#if NET
if (targets.TryGetNonEnumeratedCount(out int count) && count == 1)
#else
if (targets is ICollection<ExecutorBinding> { Count: 1 })