Skip to content

Commit be1346c

Browse files
cwechtBarry-Xu-2018
authored andcommitted
Fix unnecessary allocations in executor.cpp (ros2#2135)
Signed-off-by: Christopher Wecht <[email protected]>
1 parent ad92de5 commit be1346c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rclcpp/src/rclcpp/executor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,13 +558,14 @@ Executor::execute_any_executable(AnyExecutable & any_exec)
558558
}
559559
}
560560

561+
template<typename Taker, typename Handler>
561562
static
562563
void
563564
take_and_do_error_handling(
564565
const char * action_description,
565566
const char * topic_or_service_name,
566-
std::function<bool()> take_action,
567-
std::function<void()> handle_action)
567+
Taker take_action,
568+
Handler handle_action)
568569
{
569570
bool taken = false;
570571
try {

0 commit comments

Comments
 (0)