Skip to content

Commit

Permalink
Change condition order
Browse files Browse the repository at this point in the history
  • Loading branch information
emasab committed Aug 2, 2023
1 parent 686ffa9 commit 81651aa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/rdkafka_cgrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ void rd_kafka_cgrp_destroy_final(rd_kafka_cgrp_t *rkcg) {
rd_list_destroy(&rkcg->rkcg_toppars);
rd_list_destroy(rkcg->rkcg_subscribed_topics);
rd_kafka_topic_partition_list_destroy(rkcg->rkcg_errored_topics);
if (rkcg->rkcg_assignor && rkcg->rkcg_assignor_state &&
rkcg->rkcg_assignor->rkas_destroy_state_cb)
if (rkcg->rkcg_assignor && rkcg->rkcg_assignor->rkas_destroy_state_cb &&
rkcg->rkcg_assignor_state)
rkcg->rkcg_assignor->rkas_destroy_state_cb(
rkcg->rkcg_assignor_state);
rd_free(rkcg);
Expand Down Expand Up @@ -1915,8 +1915,9 @@ static void rd_kafka_cgrp_handle_JoinGroup(rd_kafka_t *rk,
"Unsupported assignment strategy \"%s\"",
protocol_name);
if (rkcg->rkcg_assignor) {
if (rkcg->rkcg_assignor_state &&
rkcg->rkcg_assignor->rkas_destroy_state_cb)
if (rkcg->rkcg_assignor
->rkas_destroy_state_cb &&
rkcg->rkcg_assignor_state)
rkcg->rkcg_assignor
->rkas_destroy_state_cb(
rkcg->rkcg_assignor_state);
Expand Down Expand Up @@ -1954,8 +1955,8 @@ static void rd_kafka_cgrp_handle_JoinGroup(rd_kafka_t *rk,
}

if (rkcg->rkcg_assignor && rkcg->rkcg_assignor != rkas) {
if (rkcg->rkcg_assignor_state &&
rkcg->rkcg_assignor->rkas_destroy_state_cb)
if (rkcg->rkcg_assignor->rkas_destroy_state_cb &&
rkcg->rkcg_assignor_state)
rkcg->rkcg_assignor->rkas_destroy_state_cb(
rkcg->rkcg_assignor_state);
rkcg->rkcg_assignor_state = NULL;
Expand Down

0 comments on commit 81651aa

Please sign in to comment.