Skip to content

Commit

Permalink
Reorder changes to make diff more reviewable
Browse files Browse the repository at this point in the history
  • Loading branch information
fmauch committed May 3, 2023
1 parent d356f62 commit 3adf1fb
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions hardware_interface/src/resource_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,18 @@ class ResourceStorage
remove_all_command_interfaces_from_available_list(hardware_name);
}

void remove_all_state_interfaces_from_available_list(const std::string & hardware_name)
void remove_all_command_interfaces_from_available_list(const std::string & hardware_name)
{
for (const auto & interface : hardware_info_map_[hardware_name].state_interfaces)
for (const auto & interface : hardware_info_map_[hardware_name].command_interfaces)
{
auto found_it = std::find(
available_state_interfaces_.begin(), available_state_interfaces_.end(), interface);
available_command_interfaces_.begin(), available_command_interfaces_.end(), interface);

if (found_it != available_state_interfaces_.end())
if (found_it != available_command_interfaces_.end())
{
available_state_interfaces_.erase(found_it);
available_command_interfaces_.erase(found_it);
RCUTILS_LOG_DEBUG_NAMED(
"resource_manager", "(hardware '%s'): '%s' state interface removed from available list",
"resource_manager", "(hardware '%s'): '%s' command interface removed from available list",
hardware_name.c_str(), interface.c_str());
}
else
Expand All @@ -197,25 +197,25 @@ class ResourceStorage
// "available" list - this should never be the case!
RCUTILS_LOG_WARN_NAMED(
"resource_manager",
"(hardware '%s'): '%s' state interface not in available list. "
"(hardware '%s'): '%s' command interface not in available list. "
"This should not happen (hint: multiple cleanup calls).",
hardware_name.c_str(), interface.c_str());
}
}
}

void remove_all_command_interfaces_from_available_list(const std::string & hardware_name)
void remove_all_state_interfaces_from_available_list(const std::string & hardware_name)
{
for (const auto & interface : hardware_info_map_[hardware_name].command_interfaces)
for (const auto & interface : hardware_info_map_[hardware_name].state_interfaces)
{
auto found_it = std::find(
available_command_interfaces_.begin(), available_command_interfaces_.end(), interface);
available_state_interfaces_.begin(), available_state_interfaces_.end(), interface);

if (found_it != available_command_interfaces_.end())
if (found_it != available_state_interfaces_.end())
{
available_command_interfaces_.erase(found_it);
available_state_interfaces_.erase(found_it);
RCUTILS_LOG_DEBUG_NAMED(
"resource_manager", "(hardware '%s'): '%s' command interface removed from available list",
"resource_manager", "(hardware '%s'): '%s' state interface removed from available list",
hardware_name.c_str(), interface.c_str());
}
else
Expand All @@ -224,7 +224,7 @@ class ResourceStorage
// "available" list - this should never be the case!
RCUTILS_LOG_WARN_NAMED(
"resource_manager",
"(hardware '%s'): '%s' command interface not in available list. "
"(hardware '%s'): '%s' state interface not in available list. "
"This should not happen (hint: multiple cleanup calls).",
hardware_name.c_str(), interface.c_str());
}
Expand Down

0 comments on commit 3adf1fb

Please sign in to comment.