[repo-assist] refactor: replace last sprintf with string interpolation in DefinitionCompiler#439
Merged
sergey-tihon merged 2 commits intoMay 16, 2026
Conversation
…nCompiler
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>
Contributor
There was a problem hiding this comment.
Pull request overview
Trivial refactor replacing the final sprintf in DefinitionCompiler.fs with a string-interpolation pattern already established in Utils.fs's UniqueNameGenerator.findUniq.
Changes:
- Replace
sprintf "%s%s" prefix (if i = 0 then "" else i.ToString())withif i = 0 then prefix else $"{prefix}{i}"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Replaces the sole remaining
sprintfcall in production code with the conditional string-interpolation pattern already established inUtils.fs:Before
After
This is the same pattern already used in
UniqueNameGenerator.findUniq(Utils.fs):Rationale
i.ToString()allocation before thesprintfformat callDefinitionCompilerconsistent withUtils.fssprintffrom production source code (only one remained)Test Status
✅ Build succeeded (0 errors, 210 warnings — pre-existing)
✅ All 417 unit tests passed