From 250db6bd360b0d0d4eb0da91dc2195af26d4487e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 16 May 2026 19:51:40 +0000 Subject: [PATCH 1/2] refactor: replace last sprintf with string interpolation in DefinitionCompiler Replace the sole remaining `sprintf` call in production code with the conditional string-interpolation pattern already used in Utils.fs (UniqueNameGenerator.findUniq). - sprintf "%s%s" prefix (if i = 0 then "" else i.ToString()) + if i = 0 then prefix else $"{prefix}{i}" This removes the intermediate string allocation from i.ToString() before the format call, and is consistent with the identical pattern in UniqueNameGenerator.findUniq. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/SwaggerProvider.DesignTime/DefinitionCompiler.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SwaggerProvider.DesignTime/DefinitionCompiler.fs b/src/SwaggerProvider.DesignTime/DefinitionCompiler.fs index 4d9b6eb4..4349c80e 100644 --- a/src/SwaggerProvider.DesignTime/DefinitionCompiler.fs +++ b/src/SwaggerProvider.DesignTime/DefinitionCompiler.fs @@ -78,7 +78,7 @@ and NamespaceAbstraction(name: string) = /// Generate unique name and reserve it for the type member _.ReserveUniqueName namePref nameSuffix = // TODO: Strange signature - think more let rec findUniq prefix i = - let newName = sprintf "%s%s" prefix (if i = 0 then "" else i.ToString()) + let newName = if i = 0 then prefix else $"{prefix}{i}" if not <| providedTys.ContainsKey newName then newName From 62125138bda08c4fd6344aa124b36d670ce63c2d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 16 May 2026 19:51:42 +0000 Subject: [PATCH 2/2] ci: trigger checks