Skip to content

Commit 836946e

Browse files
committed
fix bug in next_waitable logic
Signed-off-by: William Woodall <[email protected]>
1 parent 14c882d commit 836946e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rclcpp/include/rclcpp/wait_result.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,11 @@ class WaitResult final
276276
auto & wait_set = this->get_wait_set();
277277
auto rcl_wait_set = wait_set.get_rcl_wait_set();
278278
while (next_waitable_index_ < wait_set.size_of_waitables()) {
279-
auto cur_waitable = wait_set.waitables(next_waitable_index_);
279+
auto cur_waitable = wait_set.waitables(next_waitable_index_++);
280280
if (cur_waitable != nullptr && cur_waitable->is_ready(&rcl_wait_set)) {
281281
waitable = cur_waitable;
282+
break;
282283
}
283-
next_waitable_index_++;
284284
}
285285
}
286286

0 commit comments

Comments
 (0)