Skip to content

Commit

Permalink
Correct the position of a comment. (ros2#2290)
Browse files Browse the repository at this point in the history
Signed-off-by: Jiaqi Li <ljq0831@qq.com>
  • Loading branch information
Manchey authored and Barry-Xu-2018 committed Jan 12, 2024
1 parent 3fd61b5 commit 27482bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rclcpp/src/rclcpp/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ bool
ClientBase::wait_for_service_nanoseconds(std::chrono::nanoseconds timeout)
{
auto start = std::chrono::steady_clock::now();
// make an event to reuse, rather than create a new one each time
auto node_ptr = node_graph_.lock();
if (!node_ptr) {
throw InvalidNodeError();
Expand All @@ -138,6 +137,7 @@ ClientBase::wait_for_service_nanoseconds(std::chrono::nanoseconds timeout)
// check was non-blocking, return immediately
return false;
}
// make an event to reuse, rather than create a new one each time
auto event = node_ptr->get_graph_event();
// update the time even on the first loop to account for time spent in the first call
// to this->server_is_ready()
Expand Down
2 changes: 1 addition & 1 deletion rclcpp_action/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ bool
ClientBase::wait_for_action_server_nanoseconds(std::chrono::nanoseconds timeout)
{
auto start = std::chrono::steady_clock::now();
// make an event to reuse, rather than create a new one each time
auto node_ptr = pimpl_->node_graph_.lock();
if (!node_ptr) {
throw rclcpp::exceptions::InvalidNodeError();
Expand All @@ -172,6 +171,7 @@ ClientBase::wait_for_action_server_nanoseconds(std::chrono::nanoseconds timeout)
if (this->action_server_is_ready()) {
return true;
}
// make an event to reuse, rather than create a new one each time
auto event = node_ptr->get_graph_event();
if (timeout == std::chrono::nanoseconds(0)) {
// check was non-blocking, return immediately
Expand Down

0 comments on commit 27482bc

Please sign in to comment.