Skip to content

Commit

Permalink
Fix clang warning: bugprone-use-after-move (ros2#2116)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Soragna committed Apr 29, 2023
1 parent ef5dfde commit 8b9604f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rclcpp/include/rclcpp/experimental/intra_process_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ class IntraProcessManager
if (std::next(it) == subscription_ids.end()) {
// If this is the last subscription, give up ownership
subscription->provide_intra_process_data(std::move(message));
// Nothing else to do
// Last message delivered, break from for loop
break;
} else {
// Copy the message since we have additional subscriptions to serve
Expand Down Expand Up @@ -967,7 +967,7 @@ class IntraProcessManager
if (std::next(it) == subscription_ids.end()) {
// If this is the last subscription, give up ownership
ros_message_subscription->provide_intra_process_message(std::move(message));
// Nothing else to do
// Last message delivered, break from for loop
break;
} else {
// Copy the message since we have additional subscriptions to serve
Expand Down

0 comments on commit 8b9604f

Please sign in to comment.