Skip to content

Commit

Permalink
Remove unnecessary double-checking of nullptr.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Jul 1, 2024
1 parent 5715f13 commit f71c36a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,14 +471,9 @@ rmw_create_publisher(
"Strict requirement on unique network flow endpoints for publishers not supported");
return nullptr;
}
RMW_CHECK_ARGUMENT_FOR_NULL(node->data, nullptr);
const rmw_zenoh_cpp::rmw_node_data_t * node_data =
static_cast<rmw_zenoh_cpp::rmw_node_data_t *>(node->data);
if (node_data == nullptr) {
RMW_SET_ERROR_MSG(
"Unable to create publisher as node_data is invalid.");
return nullptr;
}
RMW_CHECK_ARGUMENT_FOR_NULL(node_data, nullptr);

// Get the RMW type support.
const rosidl_message_type_support_t * type_support = find_message_type_support(type_supports);
Expand Down Expand Up @@ -715,7 +710,6 @@ rmw_create_publisher(
"Unable to create liveliness token for the publisher.");
return nullptr;
}
// printf("[rmw_create_publisher] Created pub %s\n", publisher_data->entity->keyexpr().c_str());

free_token.cancel();
undeclare_z_publisher_cache.cancel();
Expand Down

0 comments on commit f71c36a

Please sign in to comment.