Skip to content

Commit

Permalink
Refs #4547: [ARS] Remove ternary operator
Browse files Browse the repository at this point in the history
Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
  • Loading branch information
JesusPoderoso committed Mar 21, 2024
1 parent 0a6b63a commit d8d4973
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions examples/cpp/hello_world/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,19 @@ int main(
auto ret = EXIT_SUCCESS;
const std::string topic_name = "hello_world_topic";
CLIParser::hello_world_config config = CLIParser::parse_cli_options(argc, argv);
uint16_t samples = config.entity == CLIParser::EntityKind::PUBLISHER ? config.pub_config.samples :
config.entity == CLIParser::EntityKind::SUBSCRIBER ? config.sub_config.samples : 0;
uint16_t samples = 0;
switch (config.entity)
{
case CLIParser::EntityKind::PUBLISHER:
samples = config.pub_config.samples;
break;
case CLIParser::EntityKind::SUBSCRIBER:
samples = config.sub_config.samples;
break;
default:
break;
}

std::string app_name = CLIParser::parse_entity_kind(config.entity);
std::shared_ptr<Application> app;

Expand Down

0 comments on commit d8d4973

Please sign in to comment.