This is an automated email from the ASF dual-hosted git repository.

alsay pushed a commit to branch tdigest
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git


The following commit(s) were added to refs/heads/tdigest by this push:
     new 4e2b8b6  added necessary side effect
4e2b8b6 is described below

commit 4e2b8b6912b539ade4f3e0114d67cacd090ee5da
Author: AlexanderSaydakov <[email protected]>
AuthorDate: Tue Mar 12 18:06:05 2024 -0700

    added necessary side effect
---
 tdigest/include/tdigest_impl.hpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tdigest/include/tdigest_impl.hpp b/tdigest/include/tdigest_impl.hpp
index c61e8d3..4411c86 100644
--- a/tdigest/include/tdigest_impl.hpp
+++ b/tdigest/include/tdigest_impl.hpp
@@ -318,6 +318,7 @@ uint8_t tdigest<T, A>::get_preamble_longs() const {
 
 template<typename T, typename A>
 size_t tdigest<T, A>::get_serialized_size_bytes() const {
+  const_cast<tdigest*>(this)->merge_buffered(); // side effect
   return get_preamble_longs() * sizeof(uint64_t) +
       (is_empty() ? 0 : (is_single_value() ? sizeof(T) : sizeof(T) * 2 + 
sizeof(centroid) * centroids_.size()));
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to