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
Signed-off-by: Mauro Passerino <mpasserino@irobot.com>
Co-authored-by: Mauro Passerino <mpasserino@irobot.com>
  • Loading branch information
2 people authored and Alberto Soragna committed Apr 28, 2023
1 parent ef5dfde commit e6ad86b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rclcpp/include/rclcpp/experimental/intra_process_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,11 @@ 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));
<<<<<<< HEAD
// Nothing else to do
=======
// Last message delivered, break from for loop
>>>>>>> 1a9b117d (Fix clang warning: bugprone-use-after-move (#2116))
break;
} else {
// Copy the message since we have additional subscriptions to serve
Expand Down Expand Up @@ -967,7 +971,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 e6ad86b

Please sign in to comment.