Skip to content

Commit

Permalink
Make if nicer and more efficient
Browse files Browse the repository at this point in the history
Co-authored-by: Sai Kishor Kothakota <[email protected]>
  • Loading branch information
destogl and saikishor authored Jan 3, 2024
1 parent 3275d39 commit 3162b29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hardware_interface/src/resource_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ bool ResourceManager::prepare_command_mode_switch(
}
return all_exist;
};
if (!check_exist(start_interfaces) || !check_exist(stop_interfaces))
if (!(check_exist(start_interfaces) && check_exist(stop_interfaces)))
{
ss_not_existing << "]" << std::endl;
RCUTILS_LOG_ERROR_NAMED(
Expand All @@ -1138,7 +1138,7 @@ bool ResourceManager::prepare_command_mode_switch(
}
return all_available;
};
if (!check_available(start_interfaces) || !check_available(stop_interfaces))
if (!(check_available(start_interfaces) && check_available(stop_interfaces)))
{
ss_not_available << "]" << std::endl;
RCUTILS_LOG_ERROR_NAMED(
Expand Down

0 comments on commit 3162b29

Please sign in to comment.