mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-01 19:18:04 +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_ = make_header(other.header_);
|
||||
index_ = other.index_;
|
||||
return *this;
|
||||
}
|
||||
HeaderIterator(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()),
|
||||
&rd_kafka_topic_partition_list_destroy);
|
||||
for (const auto& item : topic_partitions) {
|
||||
rd_kafka_topic_partition_t* new_item = nullptr;
|
||||
new_item = rd_kafka_topic_partition_list_add(handle.get(),
|
||||
item.get_topic().data(),
|
||||
item.get_partition());
|
||||
rd_kafka_topic_partition_t* new_item = rd_kafka_topic_partition_list_add(
|
||||
handle.get(),
|
||||
item.get_topic().data(),
|
||||
item.get_partition()
|
||||
);
|
||||
new_item->offset = item.get_offset();
|
||||
}
|
||||
return handle;
|
||||
|
||||
Reference in New Issue
Block a user