Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead code #10794

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/EnergyPlus/PlantUtilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -915,12 +915,6 @@ void PullCompInterconnectTrigger(EnergyPlusData &state,
// First store the current check in a single variable instead of array for readability
CurCriteria = state.dataPlantUtilities->CriteriaChecks(UniqueCriteriaCheckIndex);

// Check to make sure we didn't reuse the index in multiple components
if (CurCriteria.CallingCompLoopNum != plantLoc.loopNum || CurCriteria.CallingCompLoopSideNum != plantLoc.loopSideNum ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be useful to change this into an assert?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure,. I think this is the type of thing that should only be done once in the simulation, just not sure where to do that. Maybe move this code up into the if (UniqueCriteriaCheckIndex <= 0) block? I would think those 4 Nums would always be non-zero but this code would be better served there than here (and with the assert).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other thing that could be improved is that BranchNum and CompNum are not used. Those could be removed.

CurCriteria.CallingCompBranchNum != plantLoc.branchNum || CurCriteria.CallingCompCompNum != plantLoc.compNum) {
// Diagnostic fatal: component does not properly utilize unique indexing
}

// Initialize, then check if we are out of range
switch (CriteriaType) {
case DataPlant::CriteriaType::MassFlowRate: {
Expand Down
Loading