Skip to content

Commit fa1ba4f

Browse files
Merge pull request #444 from apache/tdigest_const_merge
non-modifying merge
2 parents b338e35 + 67da6a9 commit fa1ba4f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tdigest/include/tdigest.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class tdigest {
115115
* Merge the given t-Digest into this one
116116
* @param other t-Digest to merge
117117
*/
118-
void merge(tdigest& other);
118+
void merge(const tdigest& other);
119119

120120
/**
121121
* Process buffered values and merge centroids if needed

tdigest/include/tdigest_impl.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void tdigest<T, A>::update(T value) {
4444
}
4545

4646
template<typename T, typename A>
47-
void tdigest<T, A>::merge(tdigest& other) {
47+
void tdigest<T, A>::merge(const tdigest& other) {
4848
if (other.is_empty()) return;
4949
vector_centroid tmp(buffer_.get_allocator());
5050
tmp.reserve(buffer_.size() + centroids_.size() + other.buffer_.size() + other.centroids_.size());

0 commit comments

Comments
 (0)