Skip to content

Commit

Permalink
fixup! fix: address the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanYuYuan committed Dec 5, 2024
1 parent 09ecde7 commit 8f4949c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ class rmw_context_impl_s::Data final
const z_loaned_sample_t * sample = z_reply_ok(z_loan(reply));
z_view_string_t keystr;
z_keyexpr_as_view_string(z_sample_keyexpr(sample), &keystr);
std::string livelines_str(z_string_data(z_loan(keystr)), z_string_len(z_loan(keystr)));
std::string liveliness_str(z_string_data(z_loan(keystr)), z_string_len(z_loan(keystr)));
// Ignore tokens from the same session to avoid race conditions from this
// query and the liveliness subscription.
graph_cache_->parse_put(std::move(livelines_str), true);
graph_cache_->parse_put(std::move(liveliness_str), true);
} else {
RMW_ZENOH_LOG_DEBUG_NAMED(
"rmw_zenoh_cpp", "[rmw_context_impl_s] z_call received an invalid reply.\n");
Expand Down Expand Up @@ -439,8 +439,8 @@ static void graph_sub_data_handler(z_loaned_sample_t * sample, void * data)
}

// Update the graph cache.
std::string livelines_str(z_string_data(z_loan(keystr)), z_string_len(z_loan(keystr)));
data_shared_ptr->update_graph_cache(z_sample_kind(sample), std::move(livelines_str));
std::string liveliness_str(z_string_data(z_loan(keystr)), z_string_len(z_loan(keystr)));
data_shared_ptr->update_graph_cache(z_sample_kind(sample), std::move(liveliness_str));
}

///=============================================================================
Expand Down

0 comments on commit 8f4949c

Please sign in to comment.