Skip to content

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 <91382322+lunakhan@users.noreply.github.com>
@linux-foundation-easycla
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

2 participants