Various cleanups to ModuleSystemHeat#161
Merged
JonnyOThan merged 8 commits intoKSPModStewards:masterfrom May 7, 2026
Merged
Conversation
* Initialize fluxes, temperatures, and loopIDs in the ctor * Switch to using guard clauses * A bunch of minor formatting fixes * Avoid calling string.Format if the relevant LogType is not enabled * Delete ChangeAllLoops since it is dead code
JonnyOThan
reviewed
May 7, 2026
| public void AddFlux(string id, float sourceTemperature, float flux, bool useForNominal) | ||
| { | ||
| x_AddFluxMarker.Begin(); | ||
| using var scope = x_AddFluxMarker.Auto(); |
Member
There was a problem hiding this comment.
IIRC "auto" markers like this do not properly get removed when profiling is not enabled.
Contributor
Author
There was a problem hiding this comment.
In most cases I actually consider this a benefit, though this method is probably called too often for that to be true. Let me whip up a helper that fixes this.
Member
There was a problem hiding this comment.
I mean, the code that was there before was perfectly fine...
Contributor
Author
There was a problem hiding this comment.
It would break if an early return ever gets added or an exception is thrown. That's my main objection, especially if I'm going to be adding more of these throughout.
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.
I'm gonna tackle #150 but decided to do a cleanup pass through
ModuleSystemHeatfirst.Here's what's included:
string.Formatif the log message is not enabledChangeAllLoopsbecause it is dead codeI have tested this and everything seems to work correctly, but there should also be no behaviour changes from this.