Skip to content

Commit

Permalink
check whether task->topic_set is a subset of this->topic_set
Browse files Browse the repository at this point in the history
  • Loading branch information
kedixa committed Jun 30, 2023
1 parent ef886ec commit e5f7781
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/client/WFKafkaClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -770,19 +770,22 @@ bool KafkaClientTask::compare_topics(KafkaClientTask *task)
auto first2 = task->topic_set.cbegin(), last2 = task->topic_set.cend();
int cmp;

// check whether task->topic_set is a subset of topic_set
while (first1 != last1 && first2 != last2)
{
cmp = first1->compare(*first2);
if (cmp == 0)
return true;

if (cmp < 0)
{
++first1;
else
++first2;
}
else if (cmp < 0)
++first1;
else
return false;
}

return false;
return first2 == last2;
}

bool KafkaClientTask::check_cgroup()
Expand Down

0 comments on commit e5f7781

Please sign in to comment.