diff --git a/tdigest/include/tdigest.hpp b/tdigest/include/tdigest.hpp index 38f3b1a5..bb4f7376 100644 --- a/tdigest/include/tdigest.hpp +++ b/tdigest/include/tdigest.hpp @@ -115,7 +115,7 @@ class tdigest { * Merge the given t-Digest into this one * @param other t-Digest to merge */ - void merge(tdigest& other); + void merge(const tdigest& other); /** * Process buffered values and merge centroids if needed diff --git a/tdigest/include/tdigest_impl.hpp b/tdigest/include/tdigest_impl.hpp index afc64ef3..165bda6c 100644 --- a/tdigest/include/tdigest_impl.hpp +++ b/tdigest/include/tdigest_impl.hpp @@ -44,7 +44,7 @@ void tdigest::update(T value) { } template -void tdigest::merge(tdigest& other) { +void tdigest::merge(const tdigest& other) { if (other.is_empty()) return; vector_centroid tmp(buffer_.get_allocator()); tmp.reserve(buffer_.size() + centroids_.size() + other.buffer_.size() + other.centroids_.size());