mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-02 11:37:50 +00:00
Fix detected by PVS-Studio (#167)
* Fix PVS-Studio V591 Non-void function should return a value. V519 The 'new_item' variable is assigned values twice successively.
This commit is contained in:
committed by
Matias Fontanini
parent
4a887607b3
commit
5bfc047263
@@ -78,6 +78,7 @@ public:
|
|||||||
header_list_ = other.header_list_;
|
header_list_ = other.header_list_;
|
||||||
header_ = make_header(other.header_);
|
header_ = make_header(other.header_);
|
||||||
index_ = other.index_;
|
index_ = other.index_;
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
HeaderIterator(HeaderIterator&&) = default;
|
HeaderIterator(HeaderIterator&&) = default;
|
||||||
HeaderIterator& operator=(HeaderIterator&&) = default;
|
HeaderIterator& operator=(HeaderIterator&&) = default;
|
||||||
|
|||||||
@@ -45,10 +45,11 @@ TopicPartitionsListPtr convert(const TopicPartitionList& topic_partitions) {
|
|||||||
TopicPartitionsListPtr handle(rd_kafka_topic_partition_list_new(topic_partitions.size()),
|
TopicPartitionsListPtr handle(rd_kafka_topic_partition_list_new(topic_partitions.size()),
|
||||||
&rd_kafka_topic_partition_list_destroy);
|
&rd_kafka_topic_partition_list_destroy);
|
||||||
for (const auto& item : topic_partitions) {
|
for (const auto& item : topic_partitions) {
|
||||||
rd_kafka_topic_partition_t* new_item = nullptr;
|
rd_kafka_topic_partition_t* new_item = rd_kafka_topic_partition_list_add(
|
||||||
new_item = rd_kafka_topic_partition_list_add(handle.get(),
|
handle.get(),
|
||||||
item.get_topic().data(),
|
item.get_topic().data(),
|
||||||
item.get_partition());
|
item.get_partition()
|
||||||
|
);
|
||||||
new_item->offset = item.get_offset();
|
new_item->offset = item.get_offset();
|
||||||
}
|
}
|
||||||
return handle;
|
return handle;
|
||||||
|
|||||||
Reference in New Issue
Block a user