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

Update osltoyrenderer.cpp: auto-detect output variable -- doesn't need to be Cout if there's only on #1880

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lunakhan
Copy link

@lunakhan lunakhan commented Oct 4, 2024

auto-detect output variable -- doesn't need to be Cout if there's only one

Description

Tests

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format v17 before submitting, I definitely will look at
    the CI test that runs clang-format and fix anything that it highlights as
    being nonconforming.

auto-detect output variable -- doesn't need to be Cout if there's only one

Signed-off-by: lunakhan <[email protected]>
Copy link

CLA Not Signed

Comment on lines +143 to +150
const ustring* outputs = &output_vars[0];
if (output_vars.size() == 1) {
outputs = &output_vars[0]; // auto-detect and use the single output
} else {
// If there are multiple outputs, you could implement additional logic here
// to choose between them or provide the user with a choice.
outputs = &output_vars[0]; // default to the first output
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand what's going on here. You set outputs to point to the first element of output_vars. OK. Then if that's the only item in output_vars, you... do it again? But if there are multiple items in output_vars, you... also do the same thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants