Skip to content

Commit

Permalink
Use common API
Browse files Browse the repository at this point in the history
  • Loading branch information
Bret Ambrose committed Aug 13, 2024
1 parent 9b9ed5f commit ed47f72
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions source/request-response/request_response_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1282,11 +1282,6 @@ static uint64_t s_mqtt_request_response_client_get_next_service_time(struct aws_
return UINT64_MAX;
}

/* TODO: add aws-c-common API? */
static bool s_is_operation_in_list(const struct aws_mqtt_rr_client_operation *operation) {
return aws_linked_list_node_prev_is_valid(&operation->node) && aws_linked_list_node_next_is_valid(&operation->node);
}

static int s_add_streaming_operation_to_subscription_topic_filter_table(
struct aws_mqtt_request_response_client *client,
struct aws_mqtt_rr_client_operation *operation) {
Expand All @@ -1313,7 +1308,7 @@ static int s_add_streaming_operation_to_subscription_topic_filter_table(

AWS_FATAL_ASSERT(entry != NULL);

if (s_is_operation_in_list(operation)) {
if (aws_linked_list_node_is_in_list(&operation->node)) {
aws_linked_list_remove(&operation->node);
}

Expand Down Expand Up @@ -1892,7 +1887,7 @@ static void s_mqtt_rr_client_destroy_operation(struct aws_task *task, void *arg,
aws_hash_table_remove(&client->operations, &operation->id, NULL, NULL);
s_remove_operation_from_timeout_queue(operation);

if (s_is_operation_in_list(operation)) {
if (aws_linked_list_node_is_in_list(&operation->node)) {
aws_linked_list_remove(&operation->node);
}

Expand Down

0 comments on commit ed47f72

Please sign in to comment.