Skip to content

Commit

Permalink
Merge pull request #444 from apache/tdigest_const_merge
Browse files Browse the repository at this point in the history
non-modifying merge
  • Loading branch information
AlexanderSaydakov authored Oct 22, 2024
2 parents b338e35 + 67da6a9 commit fa1ba4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tdigest/include/tdigest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tdigest/include/tdigest_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void tdigest<T, A>::update(T value) {
}

template<typename T, typename A>
void tdigest<T, A>::merge(tdigest& other) {
void tdigest<T, A>::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());
Expand Down

0 comments on commit fa1ba4f

Please sign in to comment.