Skip to content

Commit

Permalink
Drop unnecessary assertions.
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic committed Jul 13, 2020
1 parent 3921f1c commit 468c493
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion rmw_fastrtps_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ rmw_destroy_node(rmw_node_t * node)
node->implementation_identifier,
eprosima_fastrtps_identifier,
return RMW_RET_INCORRECT_RMW_IMPLEMENTATION);
assert(node->context != nullptr);

rmw_context_t * context = node->context;
rmw_ret_t ret = rmw_fastrtps_shared_cpp::__rmw_destroy_node(
Expand Down
1 change: 0 additions & 1 deletion rmw_fastrtps_dynamic_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ rmw_destroy_node(rmw_node_t * node)
node->implementation_identifier,
eprosima_fastrtps_identifier,
return RMW_RET_INCORRECT_RMW_IMPLEMENTATION);
assert(node->context != nullptr);
rmw_context_t * context = node->context;
rmw_ret_t ret = rmw_fastrtps_shared_cpp::__rmw_destroy_node(
eprosima_fastrtps_identifier, node);
Expand Down
6 changes: 1 addition & 5 deletions rmw_fastrtps_shared_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,15 @@ __rmw_destroy_node(
{
assert(node != nullptr);
assert(node->implementation_identifier == identifier);
static_cast<void>(identifier);

assert(node->context != nullptr);
assert(node->context->impl != nullptr);
assert(node->context->impl->common != nullptr);
auto common_context = static_cast<rmw_dds_common::Context *>(node->context->impl->common);
rmw_dds_common::GraphCache & graph_cache = common_context->graph_cache;
{
std::lock_guard<std::mutex> guard(common_context->node_update_mutex);
rmw_dds_common::msg::ParticipantEntitiesInfo participant_msg =
graph_cache.remove_node(common_context->gid, node->name, node->namespace_);
rmw_ret_t ret = __rmw_publish(
node->implementation_identifier,
identifier,
common_context->pub,
static_cast<void *>(&participant_msg),
nullptr);
Expand Down

0 comments on commit 468c493

Please sign in to comment.