Skip to content

Conversation

NathanBaulch
Copy link
Contributor

I noticed a few places where files were being generated with StringBuilder in memory before writing to the FS.
Better to use StreamWriter and write directly to the FS rather than consuming unnecessary memory.
It's also a bit more readable and less error prone using WriteLine instead of \n IMO.
I've left the string interpolation in place because the code reads a little better. In theory those could be broken into multiple calls to Write to avoid even more string building behind the scenes.

@love-linger love-linger merged commit 25e6ade into sourcegit-scm:develop Jul 1, 2025
13 checks passed
@love-linger love-linger self-assigned this Jul 1, 2025
@love-linger love-linger added the enhancement New feature or request label Jul 1, 2025
@NathanBaulch NathanBaulch deleted the streamfiles branch July 1, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants