Skip to content

Commit 4f3fed0

Browse files
Merge pull request #467 from proost/refactor-use-method
refactor: clean up use get_preamble_longs
2 parents b6f736f + a3bc4e4 commit 4f3fed0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

theta/include/theta_sketch_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ size_t compact_theta_sketch_alloc<A>::get_compressed_serialized_size_bytes(uint8
376376

377377
template<typename A>
378378
void compact_theta_sketch_alloc<A>::serialize(std::ostream& os) const {
379-
const uint8_t preamble_longs = this->is_estimation_mode() ? 3 : this->is_empty() || entries_.size() == 1 ? 1 : 2;
379+
const uint8_t preamble_longs = get_preamble_longs(false);
380380
write(os, preamble_longs);
381381
write(os, UNCOMPRESSED_SERIAL_VERSION);
382382
write(os, SKETCH_TYPE);
@@ -459,7 +459,7 @@ uint8_t compact_theta_sketch_alloc<A>::compute_entry_bits() const {
459459

460460
template<typename A>
461461
void compact_theta_sketch_alloc<A>::serialize_version_4(std::ostream& os) const {
462-
const uint8_t preamble_longs = this->is_estimation_mode() ? 2 : 1;
462+
const uint8_t preamble_longs = get_preamble_longs(true);
463463
const uint8_t entry_bits = compute_entry_bits();
464464
const uint8_t num_entries_bytes = get_num_entries_bytes();
465465

0 commit comments

Comments
 (0)