From 5ecb09b0d19748196e01978b592d456586c28866 Mon Sep 17 00:00:00 2001 From: Harun Mustafa Date: Thu, 23 May 2024 22:53:32 +0200 Subject: [PATCH] fix warnings related to uninitialized values --- .../external_memory_builder_partitioned_phf.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/builders/external_memory_builder_partitioned_phf.hpp b/include/builders/external_memory_builder_partitioned_phf.hpp index 109bd1c..3864075 100644 --- a/include/builders/external_memory_builder_partitioned_phf.hpp +++ b/include/builders/external_memory_builder_partitioned_phf.hpp @@ -133,14 +133,14 @@ struct external_memory_builder_partitioned_phf { std::cout << "writing builders to disk..." << std::endl; } start = clock_type::now(); - uint64_t id = i - partition_config.num_partitions; - for (auto& builder : in_memory_builders) { - m_builders.save(builder, id); - internal_memory_builder_single_phf().swap(builder); + assert(partition_config.num_partitions == in_memory_builders.size()); + uint64_t id = 0; + while (in_memory_builders.size()) { ++id; + m_builders.save(in_memory_builders.back(), i - id); + in_memory_builders.pop_back(); } timings.partitioning_seconds += seconds(clock_type::now() - start); - assert(id == i); }; for (; i != num_partitions; ++i) { @@ -320,4 +320,4 @@ struct external_memory_builder_partitioned_phf { }; }; -} // namespace pthash \ No newline at end of file +} // namespace pthash