mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Update analyzers for .NET 10 SDK (#2611)
This commit is contained in:
@@ -46,7 +46,7 @@ internal static class RepresentationExtensions
|
||||
keySelector: sourceId => sourceId,
|
||||
elementSelector: sourceId => workflow.Edges[sourceId].Select(ToEdgeInfo).ToList());
|
||||
|
||||
HashSet<RequestPortInfo> inputPorts = new(workflow.Ports.Values.Select(ToPortInfo));
|
||||
HashSet<RequestPortInfo> inputPorts = [.. workflow.Ports.Values.Select(ToPortInfo)];
|
||||
|
||||
return new WorkflowInfo(executors, edges, inputPorts, workflow.StartExecutorId, workflow.OutputExecutors);
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ public sealed class EdgeConnection : IEquatable<EdgeConnection>
|
||||
/// contains duplicate values.</exception>
|
||||
public static EdgeConnection CreateChecked(List<string> sourceIds, List<string> sinkIds)
|
||||
{
|
||||
HashSet<string> sourceSet = new(Throw.IfNull(sourceIds));
|
||||
HashSet<string> sinkSet = new(Throw.IfNull(sinkIds));
|
||||
HashSet<string> sourceSet = [.. Throw.IfNull(sourceIds)];
|
||||
HashSet<string> sinkSet = [.. Throw.IfNull(sinkIds)];
|
||||
|
||||
if (sourceSet.Count != sourceIds.Count)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ internal sealed class FanInEdgeState
|
||||
public FanInEdgeState(FanInEdgeData fanInEdge)
|
||||
{
|
||||
this.SourceIds = fanInEdge.SourceIds.ToArray();
|
||||
this.Unseen = new(this.SourceIds);
|
||||
this.Unseen = [.. this.SourceIds];
|
||||
|
||||
this._pendingMessages = [];
|
||||
}
|
||||
@@ -40,7 +40,7 @@ internal sealed class FanInEdgeState
|
||||
if (this.Unseen.Count == 0)
|
||||
{
|
||||
List<PortableMessageEnvelope> takenMessages = Interlocked.Exchange(ref this._pendingMessages, []);
|
||||
this.Unseen = new(this.SourceIds);
|
||||
this.Unseen = [.. this.SourceIds];
|
||||
|
||||
if (takenMessages.Count == 0)
|
||||
{
|
||||
|
||||
@@ -380,7 +380,7 @@ public class WorkflowBuilder
|
||||
}
|
||||
|
||||
// Make sure that all nodes are connected to the start executor (transitively)
|
||||
HashSet<string> remainingExecutors = new(this._executorBindings.Keys);
|
||||
HashSet<string> remainingExecutors = [.. this._executorBindings.Keys];
|
||||
Queue<string> toVisit = new([this._startExecutorId]);
|
||||
|
||||
if (!validateOrphans)
|
||||
|
||||
Reference in New Issue
Block a user