Eliminates List<T>+ToArray() allocation in three JSON-parsing hot paths: - TryGetHandshakeScopes: size string[] from GetArrayLength() upfront; avoid dynamic List<string> growth and second ToArray() copy. - GetStringArrayArg (NodeCapabilities): same pattern; avoids List<string> on every capability command that receives an array argument. - ParseNodeList: pre-size GatewayNodeInfo[] from GetArrayLength(); replace three-key LINQ sort chain with Array.Sort + static Comparison<T> delegate, eliminating the intermediate IOrderedEnumerable allocations. Also adds 3 regression tests: - ParseNodeListPayload_EmptyArray_ReturnsEmpty - ParseNodeListPayload_SameOnlineStatus_SortsByLastSeenDescending - ParseNodeListPayload_SkipsItemsWithNoNodeId Test status: 633 Shared passed (+3), 20 skipped; 122 Tray passed. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| OpenClaw.Cli | ||
| OpenClaw.CommandPalette | ||
| OpenClaw.Shared | ||
| OpenClaw.Tray.WinUI | ||