Skip to content

Commit

Permalink
non-modifying merge
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSaydakov committed Oct 21, 2024
1 parent b338e35 commit 67da6a9
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 67da6a9

Please sign in to comment.