From a43e6d993e22cf21496dcdc740d6a81680989e95 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 12:58:08 +0000 Subject: [PATCH] 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> --- dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs | 6 ++---- .../WorkflowBuilderExtensions.cs | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs index 8141be1075..bee9947a6b 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs @@ -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)) { diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs index 41cceb25a3..a22aa8e722 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs @@ -62,7 +62,7 @@ public static class WorkflowBuilderExtensions Func predicate = WorkflowBuilder.CreateConditionFunc(IsAllowedTypeAndMatchingCondition)!; -#if NET6_0_OR_GREATER +#if NET if (targets.TryGetNonEnumeratedCount(out int count) && count == 1) #else if (targets is ICollection { Count: 1 }) @@ -111,7 +111,7 @@ public static class WorkflowBuilderExtensions Func predicate = WorkflowBuilder.CreateConditionFunc((Func)IsAllowedType)!; -#if NET6_0_OR_GREATER +#if NET if (targets.TryGetNonEnumeratedCount(out int count) && count == 1) #else if (targets is ICollection { Count: 1 })