From a3bc4e48551a72cfb25bfefd09b6cb22e84e0551 Mon Sep 17 00:00:00 2001 From: proost Date: Thu, 13 Nov 2025 01:16:51 +0900 Subject: [PATCH] refactor: clean up use get_preamble_longs --- theta/include/theta_sketch_impl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theta/include/theta_sketch_impl.hpp b/theta/include/theta_sketch_impl.hpp index 8f7b1e8d..304ae64c 100644 --- a/theta/include/theta_sketch_impl.hpp +++ b/theta/include/theta_sketch_impl.hpp @@ -376,7 +376,7 @@ size_t compact_theta_sketch_alloc::get_compressed_serialized_size_bytes(uint8 template void compact_theta_sketch_alloc::serialize(std::ostream& os) const { - const uint8_t preamble_longs = this->is_estimation_mode() ? 3 : this->is_empty() || entries_.size() == 1 ? 1 : 2; + const uint8_t preamble_longs = get_preamble_longs(false); write(os, preamble_longs); write(os, UNCOMPRESSED_SERIAL_VERSION); write(os, SKETCH_TYPE); @@ -459,7 +459,7 @@ uint8_t compact_theta_sketch_alloc::compute_entry_bits() const { template void compact_theta_sketch_alloc::serialize_version_4(std::ostream& os) const { - const uint8_t preamble_longs = this->is_estimation_mode() ? 2 : 1; + const uint8_t preamble_longs = get_preamble_longs(true); const uint8_t entry_bits = compute_entry_bits(); const uint8_t num_entries_bytes = get_num_entries_bytes();