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>
Signed-off-by: Tamaki Nishino <otamachan@gmail.com>
  • Loading branch information
2 people authored and otamachan committed Mar 20, 2024
1 parent 47c977d commit ade883d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rclcpp/include/rclcpp/experimental/intra_process_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ 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));
// Last message delivered, break from for loop
break;
} else {
// Copy the message since we have additional subscriptions to serve
Deleter deleter = message.get_deleter();
Expand Down Expand Up @@ -493,6 +495,8 @@ 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));
// Last message delivered, break from for loop
break;
} else {
// Copy the message since we have additional subscriptions to serve
Deleter deleter = message.get_deleter();
Expand Down

0 comments on commit ade883d

Please sign in to comment.